Understanding Language Files in Joomla 3.1
Language files are text files in Joomla 3.0 that basically list a set of common words for a specific language. The English language file may define a greeting as Hello, while a Spanish language file would define greeting as Hola.
There are many words in your Joomla 3.0 site that are printed using this type of reference. For example, if Joomla wanted to print "greeting" on your screen, the php code would reference something like GREETING. Then, based upon the language Joomla is using, it will determine the appropriate word to use, Hello or Hola.
Let's take a look at a real life example
- Written by Super User
- Written by Joomla
How are language files used?
That text, Written by, is actually defined in the following language files:
Because we have both English and Spanish installed, the Written by language will change based upon which language we have our site set to use.
When the Joomla code references the Constant, COM_CONTENT_WRITTEN_BY, it replaces it with the Value defined in the language file. The value, in this case, includes %s. That variable, %s, will be replaced by the author of the article. So, if the article was written by Bob:
|The Joomla code would read:||The result on your website would be:|
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
How can I change language files?
‹Section 1: How to change your site language in Joomla 3.1
›Section 3: Changing Text in Joomla 3.1 using Language Overrides
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!
Working with Languages in Joomla 3
|1.||How to change your site language in Joomla 3.1|
|2.||Understanding Language Files in Joomla 3.1|
|3.||Changing Text in Joomla 3.1 using Language Overrides|