Updates: Release Youtube Feed Pro v5.9.4 🥳

How to translate Joomla Component, module and plugin

Every component, module or plugin can be translated into other languages if this was written following the standard procedures.

By using the Joomla native functions, you can translate any wording that the extension is using. The extension needs to have a .INI language file that contains the translations for your Language. This will let you translate words or sentences like "Book Now", "Save", "Order" etc...

Unless you have a good text editor for .ini files, we recommend using Sublime Text for MacOS or Notepad editor for Window OS.

Depending on the type of extension, the default language pack will be saved in different locations. Refer to the table below:

Extension Location
Component Front-end & Back-end
Module (admin) Back-end
Module (site) Front-end
Plugin Back-end

Front-End

All the .INI Translation files for the front-end part of the site are located in /language/en-GB/ and that directory will contain all the default language files. If your website has other languages installed, in the same directory you will find other folders named with the prefix of your language.

All the modules and the front-end part of the component will have their .INI files in this directory.

Back-End

All the .INI Translation files for the administrator section of the site are located in /administrator/language/en-GB/ and that directory will contain all the default language files for the back-end. If your website has other languages installed, in the same directory you will find other folders named with the prefix of your language.

Only the back-end translation files of the components are located in this directory.

.INI Files

With the .ini language files we can translate all the definitions of the components, modules and plugins. Save & Close, View Detail, Edit etc.. are examples of translatable definitions.

If we wish to have these words translated in another languages, we have to translate them manually.

Example: Let's say you would like to translate the JLex Comment (has namespace is com_jlexcomment) component to Spanish, these are the steps you should follow:

1. Copy the file /language/en-GB/en-GB.com_jlexcomment.ini into the folder /language/es-ES/
2. Rename the file as /language/es-ES/es-ES.com_jlexcomment.ini
3. Open the file es-ES.com_jlexcomment.ini and translate all the English definitions into Spanish
4. Save the changes.

The .INI files structure has changed since Joomla v1.6, now it reflects the INI Standards. Make sure to respect the .INI Syntax:

INSTRUCTION="Definition"

DEFINITION = double-quote Translation double-quote

One definition per row.

Special Characters

Some definitions of the .INI files contain some special characters that you should pay attention to leave unchanged. In the details, the "wildcards" and boolean strings, should not be changed.

If you find a definition containing something like "The Room %s is not available for %d nights", you should pay attention to leave unchanged the wildcards %s and %d because the system will respectively replace them with a string and with an integer number. The result of that definition will be something like "The Room Triple Deluxe is not available for 14 nights".

Other special words that should not be translated are boolean values like "true" or "false". Leave those wordings unchanged in your translation language file because the system will probably use them for rendering Javascript code.

Encoding

It is important to pay attention to the Encoding that your Text-Editor will apply to the .INI file when saving it. This may cause unexpected results on your site if the Encoding applied is wrong. Most of the times this will cause some special characters to be displayed as unreadable symbols or characters that are not of your language.

The suggested encodings are UTF-8 or UTF-8 BOM. Most languages and websites will work just fine with the UTF-8 encoding but some languages and web-servers require the UTF-8 BOM.

Missing Translations After Updating

Components, as well as modules, are frequently updated and usually, new language definitions will be added to the translation files. If you are using an outdated translation of a previous version of the component, Joomla will more likely print the language definition which is something unreadable for the visitors of your website. This happens to all the language files except for English because that's the default language of any component.

In these cases the first thing you should do is compare the original English .INI translation file with your own translation file by using a good text-editor. The translation files should have the same number of rows and if they don't, it means that some definitions are missing. Usually you will find the missing translations at the bottom of the file because that's where the developers put the new language definitions. By copying the new and missing language definitions from the English .INI file onto your .INI translation file, you will be able to translate the new wordings and update your translation. Upload the file back onto the server and your translation will be updated.

Double Quotes Escaping

Translations containing double quotes must be "escaped" to avoid syntax errors and to break the parsing of the translations. For example, the language definition "Enable this setting before "pushing" the Rates." should be written in the .INI file as follows:

DEFINITION="Enable this setting before \"pushing\" the Rates."

By placing a Back-Slash before each double-quote, you will escape the same character used to declare the language translation. Not using the escape method will break the loading of the .INI Translation file so part of the translations will not be used or displayed in your website.

Modules

All the .INI language files of the components are named en-GB.com_jlex.....ini but translating the definitions of the component may not be sufficient when there are also some modules like a Search Form or anything else that you've published on a position of your Template.

The modules use .INI language files named en-GB.mod_jlex......ini and they are always located in the /language directory of your website. For example, if you wanted to translated the module "JLex Map Business", the file you should copy, rename and translate is the following:
/language/en-GB/en-GB.mod_mapbusiness.ini
By creating a translated-copy of that file in your language folder, the module will be translated with all its wordings.

Contents Saved in the Database

When using the component for creating new contents like a new Car, a new Room, a new Employee, a new Menu, a new Event or a new Item, you are saving some texts in the database. These contents cannot be translated by using the native Joomla! functions through the .INI language files because these are not wordings or phrases, they are contents that you have created manually.

If you don't need to translate the name or the description of a content that you created then you can just use the native functions and translate just the wordings through the .INI language files.


[1] Refer link.

Say something here...
Cancel
You are a guest ( Sign Up ? )
or post as a guest
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.

Sign in to your account

Use your social accounts to sign in