How to translate wordpress theme ?
EduPro theme allows you to translate the theme into any language. To translate the theme, there are two ways to do it.
Translating with Poedit
please do the following steps:
- Download and install POEdit translation editor (https://poedit.net/)
- Go to the theme translation folder (/wp-content/themes/edupro/languages/)
- Make a copy of the file “xx_XX.po” and rename the file to the locale of your language. For example, German would be de_DE.po. See language code list here. http://codex.wordpress.org/WordPress_in_Your_Language
- Open POEdit and load the file. (i.e de_DE.po), and set your language first
- Translate all the strings in the list and save changes. After you save, you will have two files. (i.e. de_DE.po and de_DE.mo)
- Upload these files to /wp-content/themes/edupro/languages/
- For WordPress 4.0 and above, go to Settings > General and select Site Language
- For WordPress 3.9.2 and below, open your wp_config.php file in the root, and find this line: define('WPLANG', ''); Change it into your language code. For example, define('WPLANG', 'de_DE');
- Save a backup of these files somewhere safe. If you upgrade the theme from WordPress admin, the language files will have to be re-uploaded.
Translating with Loco Translate
First of all, you need to install Loco Translate on your website, and you can do so like you do with any other WordPress plugin.
Go to Plugins > Add New, search for Loco Translate in the search field and then click on Install Now when you find it. After installing it, click on Activate.
When you are ready, you will have a new menu item named Loco Translate on the left in your Dashboard.
Click on Loco Translate > Manage Translations. You will see a screen like this:
The screenshot above shows a list of themes without any translation included in them. If they already have translations included, they will look like this:
You can now add a new language for your theme/plugin (I’ll show you how to do it for a theme, but for a plugin is exactly the same, just scroll down the list and you will find the Plugins list).
Add a new translation
Click on New language and choose which language you want to add.
The needed language files will be created and you will see a screen like this:
Click on a string in the box Source text to start translating. Type the string’s translation in your language in the box below, named Italian translation (if you are translating in Italian, it will be Dutch translation if you are translating in Dutch, etc.).
When you translated all the strings (or when you are done for the day), click on the button Save on the top to save the current status of the translation. The plugin will save the
PO file and will generate a
MO file, and your theme/plugin will use that translation from now on.