Translating The Theme

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

  1. To set your default site language go to Settings > General and select your language from the Site Language dropdown menu.
  2. Go to Plugins > Add New, search for “Loco Translate” and install and activate the plugin.

Translating Theme

  1. 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.
  2. 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”.
  3. Now you can translate the theme.

Translating Plugin

Most of the theme text is included in the GhostPool Core plugin.

  1. Go to Loco Translate > Plugins, select the GhostPool Core plugin and click the New language link.
  2. 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”.
  3. 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:

  1. For the theme go to Loco Translate > Themes, select the theme and edit your language file.
  2. For the plugin go to Loco Translate > Plugins, select the GhostPool Core plugin and edit your language file.
  3. Click the Sync button to load all the new text from .pot translation file to your language file (.po).

Poedit

Translation

  1. To set your default site language go to Settings > General and select your language from the Site Language dropdown menu.
  2. Install and open the translation program Poedit.

Translating Parent Theme

  1. Go to File > New From POT/PO File and open the translation file from magzine-theme/magzine/languages/magzine.pot.
  2. You will be asked to specify the language you want to translate to.
  3. Now click on each string and enter your translation in the text box.
  4. 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.
  5. Poedit will create a .po and .mo file containing your translations. Upload these files to wp-content/languages/themes/.

Translating Child Theme

  1. Go to File > New From POT/PO File and open the translation file from magzine-child/languages/magzine.pot.
  2. 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.
  3. 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.

  1. Go to magzine-theme/magzine/ and unzip ghostpool-core.zip.
  2. Next go to File > New From POT/PO File and open the translation file from magzine-theme/magzine/ghostpool-core/languages/ghostpool-core.pot.
  3. You will be asked to specify the language you want to translate to.
  4. Now click on each string and enter your translation in the text box.
  5. 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.
  6. 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:

  1. For the theme insert your modified translation file (e.g. magzine-en_US.po) into the magzine-theme/magzine/languages/ folder.
  2. Now open this file in Poedit and click Update and it will display the text changes from the latest theme update.
  3. Upload your updated .po and .mo files to wp-content/languages/themes/.
  4. For the plugin insert your modified translation file (e.g. ghostpool-core-en_US.po) into the magzine-theme/magzine/ghostpool-core/languages/ folder.
  5. Now open this file in Poedit and click Update and it will display the text changes from the latest theme update.
  6. Upload your updated .po and .mo files to wp-content/languages/plugins/ directory.