Difference between revisions of "Amending the templateDetails.xml file"

From Joomla! Documentation

m (Added to some relevant categories.)
(There is no folder called "admin", so deleted that section. Adding the folder="admin" is not necessary, since we use the administration tags before. See JA Purity for proof of this.)
Line 31: Line 31:
  
 
     <administration>
 
     <administration>
         <languages folder=”admin”>
+
         <languages>
 
             <language tag=”en-GB”>en-GB.tpl_beez.ini</language>
 
             <language tag=”en-GB”>en-GB.tpl_beez.ini</language>
 
             <language tag=”de-DE”>de-DE.tpl_beez.ini</language>
 
             <language tag=”de-DE”>de-DE.tpl_beez.ini</language>
Line 40: Line 40:
 
</source>
 
</source>
  
Note that in the administration ''<nowiki><languages></nowiki>'' tag the ''folder'' attribute is used. This is because the language files for the front-end and back-end 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 front-end language files.
+
Note that the language files for the back-end are placed automatically in the folders ''en-GB'' and ''de-DE'' in ''administrator/language/'', if the tags and administration hierarchy as stated above is used.
 
<noinclude>[[Category:Templates]][[Category:Languages]]</noinclude>
 
<noinclude>[[Category:Templates]][[Category:Languages]]</noinclude>

Revision as of 10:33, 28 April 2009

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. These 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. [[[ Check: These did not get translated at one time. Has this been fixed? ]]]

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 front-end strings; the other for the administrator back-end 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>
            <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 the language files for the back-end are placed automatically in the folders en-GB and de-DE in administrator/language/, if the tags and administration hierarchy as stated above is used.