Translation

Translating with WP Customizer

Some most important phrases are available to change directly in the Customize panel. These phrases are:

  1. Latest stories title on home page, in Home section
  2. More stories title on home page, in Home section
  3. Latest stories title on archive pages, in Posts › Archive section
  4. More stories title on archive pages, in Posts › Archive section
  5. Newsletter titles and labels, in Newsletter section (available only if the Mailchimp plugin is activated)

Translation with Loco Translate plugin

The Loco Translate plugin is the best, in our opinion, tool for translating/changing all phrases in the theme. As stated above, you can use it to change phrases without changing your current language.

Requirements

In order to localize your theme and plugins, create a directory named "languages" inside of "wp-content", if it does not already exist. Make sure that your web server has write permissions to this directory. If you're not familiar with this subject, please first read about Wordpress file permissions.

How to translate?

  1. Install the Loco Translate plugin.
  2. Go to the WP Admin Panel › Loco Translate.
  3. Find on the list your target theme/plugin (Screen 1, Point 1)

    Screen 1 Choose theme/plugin to translate

  4. Click "New language" (Screen 1, Point 2).
  5. Select your language (let's say "Spanish", code "es_ES"). Remember that this translation will be loaded only if your site language in WordPress Admin › Settings › General › Language is the same.
  6. Translate all phrases (Screen 2, Point 1 and 2) and click "Save" (Screen 2, Point 3) to generate all necessary translation files.

    Screen 2 Save translation

If everything goes well, you should find translation files under the directory:

For theme

wp-content/languages/themes/starmile-es_ES.po
wp-content/languages/themes/starmile-es_ES.mo

For plugin (e.g. G1 Socials)

wp-content/languages/plugins/g1_socials-es_ES.po
wp-content/languages/plugins/g1_socials-es_ES.mo

Keep translations safe after future updates

Because we don't use the theme/plugins related directories to store translations you have nothing to worry about. All custom translations are stored in the wp-content/languages directory so unless you reinstall the entire Wordpress installation, all is safe there. You can update the theme and each plugin without losing their translations. You don't even need to use the child theme.