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.
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"
![]() | 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 |
|---|---|
Files must be saved in UTF-8. |
![]() | 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 :
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! |
Comments
- No comments found
Additional information
If you use and find our Joomla extensions useful please consider supporting their further development.
Most Recent Forum entries
Issue Tracker - Recently Closed Issues
-
AN4IGZU1PQ - Change redirection after issue crea>Project Name: Issue Tracker - Rel 1.3.1
Close date: 2013-05-21 16:21:20 -
A5LSHJOSS9 - Add button to issue list to 'view' >Project Name: Issue Tracker - Rel 1.3.1
Close date: 2013-05-21 14:58:14 -
AXSLWZW64W - Add a create button to the issue li>Project Name: Issue Tracker - Rel 1.3.1
Close date: 2013-05-20 16:56:53 -
A39R3RDOT5 - Correct identified by in back end o>Project Name: Issue Tracker - Rel 1.3.1
Close date: 2013-05-20 14:07:36 -
ARLD9BAPZ7 - Add new project filter to front end>Project Name: Issue Tracker - Rel 1.3.1
Close date: 2013-04-29 17:19:00
Quote(s) of the Day
Entrepreneurs are simply those who understand that there is little difference between obstacle and opportunity and are able to turn both to their advantage.
Niccolo Machiavelli
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
Antoine de Saint-Exupéry


![[Note]](/media/com_docimport/admonition/note.png)
![[Tip]](/media/com_docimport/admonition/tip.png)
Leave your comments