Creating Your Own Language Pack

This article describes how to create a translation for the “All Video Share” component. As an example, we are going to use our English language pack and translate it to French by doing some little modifications.

Only need to change a few words? You do not need a language pack for that. Go to System → Manage → Language Overrides, choose your language, search for the text you want to change and override just that one string. A full language pack is only worth building when you are translating the whole extension.

1. Download English (en-GB).

The package name itself describes that the language is English. Basically Joomla! follow a standard language naming convention [xx-XX] which is made of [iso639 language code]-[iso3166 country code]

So, “en-GB” in our package name represents the English language of the United Kingdom. Since we are going to create a translation for French, our language tag would be “fr-FR”.

Note: Kindly use the appropriate language tag to which you translate the component.

2. Extract the downloaded zip file.

You should get the following file structure. The component and the plugins are translated in the administrator folder, and the component front end and the modules in the site folder.

  • pkg_en-GB.com_allvideoshare.xml
  • administrator/language/en-GB/com_allvideoshare.ini
  • administrator/language/en-GB/com_allvideoshare.sys.ini
  • administrator/language/en-GB/plg_content_allvideoshareplayer.ini
  • administrator/language/en-GB/plg_content_allvideoshareplayer.sys.ini
  • administrator/language/en-GB/plg_content_allvideoshareyoutube.ini
  • administrator/language/en-GB/plg_content_allvideoshareyoutube.sys.ini
  • administrator/language/en-GB/plg_editors-xtd_allvideoshareyoutube.ini
  • administrator/language/en-GB/plg_editors-xtd_allvideoshareyoutube.sys.ini
  • administrator/language/en-GB/plg_finder_allvideoshare.ini
  • administrator/language/en-GB/plg_finder_allvideoshare.sys.ini
  • site/language/en-GB/com_allvideoshare.ini
  • site/language/en-GB/mod_allvideosharecarousel.ini
  • site/language/en-GB/mod_allvideosharecarousel.sys.ini
  • site/language/en-GB/mod_allvideosharegallery.ini
  • site/language/en-GB/mod_allvideosharegallery.sys.ini
  • site/language/en-GB/mod_allvideoshareplayer.ini
  • site/language/en-GB/mod_allvideoshareplayer.sys.ini
  • site/language/en-GB/mod_allvideoshareplaylist.ini
  • site/language/en-GB/mod_allvideoshareplaylist.sys.ini
  • site/language/en-GB/mod_allvideosharesearch.ini
  • site/language/en-GB/mod_allvideosharesearch.sys.ini
  • site/language/en-GB/mod_allvideoshareyoutube.ini
  • site/language/en-GB/mod_allvideoshareyoutube.sys.ini

The .ini files hold the text you see while using the extension. The .sys.ini files hold the names and descriptions Joomla shows in the Extensions and Plugins lists.

3. Open pkg_en-GB.com_allvideoshare.xml in your favorite Text editor.

4. Search for “en-GB” in the whole document and replace them with “fr-FR”.

5. Edit the tag as “French language pack for All Video Share.”

6. That’s it. Save the file. We have prepared the pkg_en-GB.com_allvideoshare.xml file for French.

7. Now, open the “administrator” folder and rename the “en-GB” folder to “fr-FR”. Do the same for the “en-GB” folder inside the “site” folder. The file names themselves do not change — only the folder names.

8. Then open the com_allvideoshare.ini file in your Text editor. Please remember all .ini files should be saved as UTF-8 without BOM encoding.

You can see that each line from the file consists of a pair of strings separated by an equals sign like this,

KEY=”VALUE”

where “KEY” is a string to be translated and “Value” is the translated string. For example,

COM_ALLVIDEOSHARE=”All Video Share”

What all you need is, just replace the string after the (=) sign in to your own French string. For example,

COM_ALLVIDEOSHARE=”Your French String”

A few rules to keep in mind while translating:

  • Never change the KEY, only the text between the quotation marks. The extension looks the text up by its key.
  • Keep the placeholders. Some strings contain %s or %1$s — these are replaced with a value at run time, so they must survive into your translation.
  • Keep any HTML. A few strings contain tags such as <br /> or <strong>. Translate the words around them and leave the tags alone.
  • Escape double quotes inside a value by writing them as \", or Joomla will not read the line.
  • You do not have to translate everything. Any key you leave out falls back to English, so a partial translation still works.

9. Kindly follow the same in all .ini files, in both the “administrator” and “site” folders.

10. That’s it. Finally, compress the package into a ZIP file called pkg_lang-prefix-LANG-PREFIX.com_allvideoshare.zip (in our example the package will name as pkg_fr-FR.com_allvideoshare.zip) Now the translation is ready and can be installed via standard Joomla! installation procedure.

Zip the contents of the folder — the XML file and the administrator and site folders — not the folder itself, or Joomla will not find the manifest.

11. After installing, make sure your language is installed and enabled in Joomla under System → Manage → Languages. All Video Share then follows whichever language the site or the administrator is set to.

12. Congrats! you have translated the component to your language. Kindly mail the translated version to admin@mrvinoth.com. So, we will add it to the site for public use.

Scroll to Top