The theme and plugin is localisation ready so they can easily translated into your language. This documentation covers two methods to create your translation. The easiest method is to use a plugin called Loco Translate and more advanced users can use Poedit.
Loco Translate
Translation
- To set your default site language go to Settings > General and select your language from the Site Language dropdown menu.
- Go to Plugins > Add New, search for “Loco Translate” and install and activate the plugin.
Translating Theme
- Go to Loco Translate > Themes, select the theme (if you’re using a child theme make sure you select the parent theme) and click the New language link.
- This will take you to a page where you can choose the language and location. Select the language that matches the one you selected from Settings > General and set the location to “System”.
- Now you can translate the theme.
Translating Plugin
Most of the theme text is included in the GhostPool Core plugin.
- Go to Loco Translate > Plugins, select the GhostPool Core plugin and click the New language link.
- This will take you to a page where you can choose the language and location. Select the language that matches the one you selected from Settings > General and set the location to “System”.
- Now you can translate the theme.
Updating Translations
If you update the theme/plugin and new text needs to be translated you also need to update the language file as follows:
- For the theme go to Loco Translate > Themes, select the theme and edit your language file.
- For the plugin go to Loco Translate > Plugins, select the GhostPool Core plugin and edit your language file.
- Click the Sync button to load all the new text from .pot translation file to your language file (.po).
Poedit
Translation
- To set your default site language go to Settings > General and select your language from the Site Language dropdown menu.
- Install and open the translation program Poedit.
Translating Parent Theme
- Go to File > New From POT/PO File and open the translation file from magzine-theme/magzine/languages/magzine.pot.
- You will be asked to specify the language you want to translate to.
- Now click on each string and enter your translation in the text box.
- After translating the strings save your file. The filename should be prefixed with “magzine” followed by the country code, so a Norwegian translation will be saved as magzine-nb_NO.po.
- Poedit will create a .po and .mo file containing your translations. Upload these files to wp-content/languages/themes/.
Translating Child Theme
- Go to File > New From POT/PO File and open the translation file from magzine-child/languages/magzine.pot.
- After translating the strings save your file. The filename should NOT prefixed with “magzine”, so a Norwegian translation will be saved as nb_NO.po.
- Poedit will create a .po and .mo file containing your translations. Upload these files to wp-content/themes/magzine-child/languages/.
Translating Plugin
Most of the theme text is included in the GhostPool Core plugin.
- Go to magzine-theme/magzine/ and unzip ghostpool-core.zip.
- Next go to File > New From POT/PO File and open the translation file from magzine-theme/magzine/ghostpool-core/languages/ghostpool-core.pot.
- You will be asked to specify the language you want to translate to.
- Now click on each string and enter your translation in the text box.
- After translating the strings save your file. The filename should be prefixed with “ghostpool-core” followed by the country code, so a Norwegian translation will be saved as ghostpool-core-nb_NO.po.
- Poedit will create a .po and .mo file containing your translations. Upload these files to wp-content/languages/plugins/.
Updating Translations
If you update the theme and new text needs to be translated you also need to update the language file as follows:
- For the theme insert your modified translation file (e.g. magzine-en_US.po) into the magzine-theme/magzine/languages/ folder.
- Now open this file in Poedit and click Update and it will display the text changes from the latest theme update.
- Upload your updated .po and .mo files to wp-content/languages/themes/.
- For the plugin insert your modified translation file (e.g. ghostpool-core-en_US.po) into the magzine-theme/magzine/ghostpool-core/languages/ folder.
- Now open this file in Poedit and click Update and it will display the text changes from the latest theme update.
- Upload your updated .po and .mo files to wp-content/languages/plugins/ directory.