Difference between revisions of "Amending the templateDetails.xml file"
From Joomla! Documentation
(Marked this version for translation) |
(Some markup changes.) |
||
Line 3: | Line 3: | ||
<translate> | <translate> | ||
<!--T:1--> | <!--T:1--> | ||
− | To ensure that your template is fully internationalised you must make sure that certain XML elements are translated and that the language definition files are listed in the | + | To ensure that your template is fully internationalised you must make sure that certain XML elements are translated and that the language definition files are listed in the ''templateDetails.xml'' file. |
</translate> | </translate> | ||
<translate> | <translate> | ||
− | + | == Translating ''templateDetails.xml'' == <!--T:2--> | |
− | A couple of the elements in the | + | A couple of the elements in the ''templateDetails.xml'' file are used in the Template Manager and are themselves translatable. The description should always be translated. |
</translate> | </translate> | ||
Line 31: | Line 31: | ||
<translate> | <translate> | ||
− | + | == Adding Language Definition Files to ''templateDetails.xml'' == <!--T:8--> | |
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T:9--> | <!--T:9--> | ||
− | All language files must be declared in the | + | All language files must be declared in the ''templateDetails.xml'' file. This is done by adding two ''<nowiki><language></nowiki>'' elements for each language to be included with the template: one for the Frontend strings, the other for the Administrator Backend strings. For example, the two British English language files and the two German language files for the Beez template are declared as follows: |
</translate> | </translate> | ||
− | < | + | <syntaxhighlight lang="xml"> |
<?xml version=”1.0” encoding=”utf-8” ?> | <?xml version=”1.0” encoding=”utf-8” ?> | ||
<install version=”1.5” type=”template”> | <install version=”1.5” type=”template”> | ||
Line 59: | Line 59: | ||
</install> | </install> | ||
− | </ | + | </syntaxhighlight> |
<translate> | <translate> | ||
<!--T:10--> | <!--T:10--> | ||
− | Note that in the administration ''<nowiki><languages></nowiki>'' tag the ''folder'' attribute is used. This is because the language files for the | + | Note that in the administration ''<nowiki><languages></nowiki>'' tag the ''folder'' attribute is used. This is because the language files for the Frontend and Backend have the same file names and so cannot exist in the same directory within the template package file. In this example, the administration language files have been placed in a sub-directory called ''admin'' to separate them from the Frontend language files. |
</translate> | </translate> | ||
Latest revision as of 22:38, 23 September 2022
To ensure that your template is fully internationalised you must make sure that certain XML elements are translated and that the language definition files are listed in the templateDetails.xml file.
Translating templateDetails.xml[edit]
A couple of the elements in the templateDetails.xml file are used in the Template Manager and are themselves translatable. The description should always be translated.
name | Name of the template. For example, Beez |
description | Description of the template |
These fields are also shown to the user during template installation.
Adding Language Definition Files to templateDetails.xml[edit]
All language files must be declared in the templateDetails.xml file. This is done by adding two <language> elements for each language to be included with the template: one for the Frontend strings, the other for the Administrator Backend strings. For example, the two British English language files and the two German language files for the Beez template are declared as follows:
<?xml version=”1.0” encoding=”utf-8” ?>
<install version=”1.5” type=”template”>
.........
<languages>
<language tag=”en-GB”>en-GB.tpl_beez.ini</language>
<language tag=”de-DE”>de-DE.tpl_beez.ini</language>
</languages>
.........
<administration>
<languages folder=”admin”>
<language tag=”en-GB”>en-GB.tpl_beez.ini</language>
<language tag=”de-DE”>de-DE.tpl_beez.ini</language>
</languages>
</administration>
</install>
Note that in the administration <languages> tag the folder attribute is used. This is because the language files for the Frontend and Backend have the same file names and so cannot exist in the same directory within the template package file. In this example, the administration language files have been placed in a sub-directory called admin to separate them from the Frontend language files.