Search

Creating a component Language Pack

This article describes one method of creating a language translation for a Joomla! extension, in this case Macrotone's Issue Tracker.
 
For translating extensions for Joomla! 1.6, 1.7, 2.5 see this article: Creating language packs for extensions in Joomla 1.6/1.7  http://docs.joomla.org/Creating_language_packs_for_extensions_in_Joomla_1.6/1.7

For an example we will illustrate the build of the Portuguese Brazilian language for the Macrotone Issue Tracker component.

1) We will prepare folder structure for the new created translation. Create the following folders on your disc:

    lang/admin
    lang/site

Open text editor and paste the the following content:

     <html><body bgcolor="#FFFFFF"></body></html>

Save it as index.html in all folders (as lang/admin/index.html, lang/site/index.html and lang/index.html).

2) Unzip the Macrotone Issue Tracker component ZIP file somewhere on your disc. Go to:

    admin/language/en-GB/ folder (which is included in the unzipped Macrotone Issue Tracker structure)

and open both files:

    en-GB.com_issuetracker.ini
    en-GB.com_issuetracker.sys.ini

in your text editor. Translate the strings to your language and save them as (in our example we use Portuguese Brazilian prefixes):

    lang/admin/pt-BR.com_issuetracker.ini
    lang/admin/pt-BR.com_issuetracker.sys.ini

Go to:

    site/language/en-GB/ folder (which is included in the unzipped Macrotone Issue Tracker structure)

and open the file:

    en-GB.com_issuetracker.ini

in text editor. Translate the strings to your language and save it as (in our example we use Portuguese Brazilian prefixes):


    lang/site/pt-BR.com_issuetracker.ini

Files should be saved as UTF-8 without BOM encoding.

3) Open text editor and paste there the following content:

<?xml version="1.0" encoding="UTF-8"?>
<extension type="file" version="2.5" method="upgrade">
    <name>pt-BR.com_issuetracker</name>
    <tag>pt-BR</tag>
<version>1.1.0</version>
    <creationDate>01/04/2012</creationDate>
    <author>Macrotone Consulting Ltd</author>
    <authorEmail> This email address is being protected from spambots. You need JavaScript enabled to view it. </authorEmail>
    <authorUrl>http://www.macrotoneconsulting.co.uk</authorUrl>
    <copyright>(C) 2012 Macrotone Consulting Ltd</copyright>
    <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
    <description>Brazilian-Portuguese language pack for Macrotone Issue Tracker</description>

    <fileset>
       <files folder="admin" target="administrator/language/pt-BR">
          <filename>pt-BR.com_issuetracker.ini</filename>
          <filename>pt-BR.com_issuetracker.sys.ini</filename>        
          <filename>index.html</filename>
       </files>
 
       <files folder="site" target="language/pt-BR">
          <filename>pt-BR.com_issuetracker.ini</filename>        
          <filename>index.html</filename>
       </files>
    </fileset>
</extension>

Edit it, changing the language specifics and the author as required and save it as :

    lang/install.xml file.

So now you should have the following folder structure in the folder lang:

    install.xml
    index.html
    admin/index.html
    admin/pt-BR.com_issuetracker.ini
    admin/pt-BR.com_issuetracker.sys.ini
    site/index.html
    site/pt-BR.com_issuetracker.ini

Select all files included in lang folder and add them into ZIP file called lang-prefix-LANG-PREFIX.com_issuetracker.zip (in our example the file will have the following name: pt-BR.com_issuetracker.zip).

Now the translation is ready and can be installed via standard Joomla! installation procedure.

Remember that the Joomla Language core pack for your desired language must be installed otherwise the language installation will fail.

What is allowed in .ini files

Comments are made by a leading ";"

The translated string must be enclosed by double quotes.

COM_ISSUETRACKER_SAMPLE_PARAMETER_FILE_NOT_WRITABLE="Can not make the parameter file writable"

Do not split translations into multiple lines (only first line will show up).

COM_ISSUETRACKER_SAMPLE_PARAMETER_FILE_NOT_WRITABLE="Can not make the
parameter file writable"

If you want a new line, write

<br />

i.e.

COM_ISSUETRACKER_SAMPLE_PARAMETER_FILE_NOT_WRITABLE="Can not make the <br /> parameter file writable"
[Note]Ensure your translations are valid XHTML 1.0

Not <br>, not <br/> - only <br /> is valid.

If unsure, please use the current markup method.


[Note]Note

Files must be saved in UTF-8.


[Tip]Tip

Take care when using Double Quotes (") in your translation, used incorrectly it will break the translation.

Under Joomla! trying to escape double quote in language files will cause issues with some php versions :


COM_ISSUETRACKER_STICKY="My great \" string which is broken"

 

The way to escape double quote is the following :

 

COM_ISSUETRACKER_STICKY="My great "_QQ_" string which is broken"

 

This may seem strange, but it's the only way to escape double quote under Joomla!

Leave your comments

0Character restriction
Your text should be more than 25 characters
terms and condition.
  • No comments found

Additional information

The Macrotone Consulting Web site would like to use cookies to store information on your computer, to improve our website. Cookies used for the essential operation of the site have already been set. To find out more about the cookies we use and how to delete them, see our privacy policy.

I accept cookies from this site.