---
title: "Joomla 2.5 Templates &#8211; $this->language"
description: "In our last few tutorials, we have covered the $this variable in Joomla 2.5 templates. We will continue focusing on $this, and this time examining the following code: &lt;html..."
url: https://www.inmotionhosting.com/support/edu/joomla/joomla-2-5/this-language/
date: 2012-07-19
modified: 2021-08-16
author: "Brad Markle"
categories: ["Joomla", "Joomla 2.5"]
tags: ["Joomla v2.5"]
type: post
lang: en
---

# Joomla 2.5 Templates &#8211; $this->language

In our last few tutorials, we have covered the [$this variable in Joomla 2.5 templates](/support/edu/joomla/joomla-2-5/this/). We will continue focusing on $this, and this time examining the following code:

<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
The output of the above PHP code results in the following code being shown in our pages:

<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr" >
If you are familiar with PHP, you can see that the value of **$this->language** is *en-gb*. en-gb stands for the English language as used in the United Kingdom.

If we [change the language in Joomla 2.5](/support/edu/joomla/joomla-2-5/change-site-language/) to Spanish, you can see that the value of $this->language changes to es-es:

<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="es-es" lang="es-es" dir="ltr" >
