Today I want to show you how to translate a WordPress theme in few easy steps. First, there are 2 ways to translate a theme. One it's to translate it in a single language and the other is to translate it in multi-languages.
For the multi-languages, we recommend you to use WPML Plugin. For this you will have all the documentation in the plugin on how to use it. So we'll gonna discuss only the single language mode. Let's get it started:
1. Download & install PoEdit free software: http://poedit.net/download.php.
2. Go in the theme's files, in the /lang/ folder where you will find the default.po language file. Open this file with PoEdit.
3. Translating the strings:
The basic translation screen consists of a list of strings for translation and two separate windows for the original string and the translated string.
The process is easy:
- Click on a string from the pool
- Add the translation in the translation modal (there could be developer notes in the modal on the right, so don’t forget to look for those)
- Save your translation
Translated strings are shown next to the original in the pool of strings and you can keep track of your progress in the bottom of the translation screen.
4. Save the edited file as a new one in the same lang folder of the theme, with the name of your language slug. Example: for romanian language you will save it as ro_RO.po.
5. Next go to wp-confing.php and add at the end of the file this code: define("WPLANG", “ro_RO”); - where the ro_RO slug should coincide with your language slug which you used for the file name too.
That's it. If you have any other problems, please don't hesitate to contact us. :)