Difference between revisions of "Creating a language definition file"

From Joomla! Documentation

m
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{version|2.5,3.1}}
 
Important note: Joomla language INI files must be saved as UTF-8 without the Byte Order Mark (BOM)<ref name="ftn2">For more information on Byte Order Mark see [http://unicode.org/faq/utf_bom.html#BOM http://unicode.org/faq/utf_bom.html#BOM]</ref>.
 
Important note: Joomla language INI files must be saved as UTF-8 without the Byte Order Mark (BOM)<ref name="ftn2">For more information on Byte Order Mark see [http://unicode.org/faq/utf_bom.html#BOM http://unicode.org/faq/utf_bom.html#BOM]</ref>.
  
Line 7: Line 8:
 
where “''KEY''” is a string to be translated and “''Value''” is the translated string. For example
 
where “''KEY''” is a string to be translated and “''Value''” is the translated string. For example
  
  ADDITIONAL INFORMATION=Additional Information
+
  ADDITIONAL_INFORMATION="Additional Information"
  
 
The “''KEY''” must be in all capitals or the string will not be found. The case of the source string does not matter as strings are folded to upper case before searching takes place. So “additional information”, “Additional Information” or even “AdDiTiOnAl InFoRmAtIoN” will be matched.
 
The “''KEY''” must be in all capitals or the string will not be found. The case of the source string does not matter as strings are folded to upper case before searching takes place. So “additional information”, “Additional Information” or even “AdDiTiOnAl InFoRmAtIoN” will be matched.
Line 14: Line 15:
  
 
The "''VALUE''" cannot include double-quote characters (").  To get a double-quote character you must use the HTML special character sequence "&amp;quot;" instead.  Single-quote characters (') are valid.
 
The "''VALUE''" cannot include double-quote characters (").  To get a double-quote character you must use the HTML special character sequence "&amp;quot;" instead.  Single-quote characters (') are valid.
 +
 +
More information about the discussed changed for the Joomla 2.5 and 3.x series can be found on the page [[Specification of language files]] {{JVer|2.5}} {{JVer|3.x}}
 
<noinclude>
 
<noinclude>
 
----
 
----
<references/>[[Category:Languages]]</noinclude>
+
<references/>[[Category:Tutorials]][[Category:Language Development]]</noinclude>
More information about the discussed changed for Joomla 1.6 can be found on the page [[1.6: Specification of language files]]
 

Revision as of 01:50, 17 August 2014

Important note: Joomla language INI files must be saved as UTF-8 without the Byte Order Mark (BOM)[1].

The format of language definition files is very basic. Blanks lines and lines beginning with “#” are ignored and the latter may be used to add comments to the file. Each line consists of a pair of strings separated by an equals sign like this

KEY=Value

where “KEY” is a string to be translated and “Value” is the translated string. For example

ADDITIONAL_INFORMATION="Additional Information"

The “KEY” must be in all capitals or the string will not be found. The case of the source string does not matter as strings are folded to upper case before searching takes place. So “additional information”, “Additional Information” or even “AdDiTiOnAl InFoRmAtIoN” will be matched.

The “KEY” can include spaces and other punctuation characters but there should not be any spaces either side of the equals sign as spaces are significant. If more than one entry has the same left-hand side, the last one to be encountered is the one that will be used.

The "VALUE" cannot include double-quote characters ("). To get a double-quote character you must use the HTML special character sequence "&quot;" instead. Single-quote characters (') are valid.

More information about the discussed changed for the Joomla 2.5 and 3.x series can be found on the page Specification of language files Joomla 2.5 Joomla 3.x


  1. For more information on Byte Order Mark see http://unicode.org/faq/utf_bom.html#BOM