How to use .pot file to translate the theme.
We recommend using Poedit software for translation-related purposes. To translate the theme to your language, please follow these steps:
- Download and install Poedit software.
- Navigate to the themes/theme_name/languages/ folder and locate .pot file. Copy it to your desktop for editing.
- Double click on the .pot file. In the Poedit window click on the "Create New Translation" button, choose the necessary language of the translation from the dropdown list and click "OK."
- Now select the constant text string you need to translate from the "Source text - English" field and type in the necessary translation into the "Translation" field. You can translate as much as you want, just go through the file and click on each string in Poedit and add your translation.
- Next, you have to save the changes to your .po file using the naming convention based on the language code (e.g. ptfor Portuguese) followed by the country code (for instance _BR for Brazil). To do that click on the "sheet" icon (you can also use hotkeys CMD+Shift+S in OS X or Win+S in Windows) and type in the name according to the screenshot below. The first lower-case letters define the language, whereas the second upper-case letter defines the country. In most cases, the language and country are the same, like “de_DE” for Germany. However, there is a difference for languages like English or Portuguese, which are spoken in several countries natively. In this case, the difference is in the first and second letter pairs; for the UK, the code would be en_GB, whereas the en_US stands for the USA. If you are not familiar with the codes for your native language and country, then visit the GNU website. See Language Codes and Country Codes for the lists of codes. Please note, if you use the wrong naming convention WordPress can not process your translation.
- When saving your .po file, Poedit automatically creates a new .mo file, with the same naming convention. According to the example above, the file would be called pt_BR.mo.
- Upload the .po and .mo files you just created to the .../languages/ folder. Make sure these files are in the same directory as the default.pot one.
- OPTIONAL! Some themes are using Themerex Addons plugin, so most of the translation are done in language files of this plugin in this directory: wp-content\plugins\trx_addons\languages. There you will see trx_addons.pot file. Please, generate .po and .mo files according to your language, the file names should look like this: trx_addons-fr_FR.po and trx_addons-fr_FR.mo.
!Important Make sure that the language of your files is the same as in your Wordpress admin panel - Settings - General Settings.