Translating strings

Whether you have a multi-language site or not, you may wish to change the text of some theme elements, such as search box placeholder text, error messages or metadata description. To do that you will need to create .po files for the respective languages. A great (free) plugin for such a task is Loco Translate. Once installed, follow the steps below to modify some strings.

1.

Loco Translate creates it’s own menu item in the WordPress admin dashboard.
Navigate to Themes.

Loco Translate - Themes
2.

Regardless of whether or not you’re using a child theme, pick Chap from the theme list, because only the parent theme contains a list of all the available strings.

Translate Chap theme
3.

Create a new language.

Adding a new language.
4.

Choose the language you wish to translate or modify. If you don’t have a multi-lingual site and just want to alter the original words, choose the language you have chosen under Settings -> General -> Site Language. Select your preferred location for the new language file and hit Start Translating.

Don’t store the .po file in /wp-content/themes/chap folder because it is removed with theme updates.
It's safest so choose a custom location to store the translations
5.

You will be placed in an editor where you can search for the string you wish to change, then select it and add your replacement/translation to the bottom textarea.

Changing the search input placeholder text
6.

After you’ve made your changes hit Save and you’re all done.

The placeholder text for a search widget input has been changed:

Changed search input placeholder

If you wish to return later and edit some more strings, just go to Loco Translate -> Themes -> Chap again and choose Edit for your language file.

If you were to delete the .po file then your changes will be lost and default values will be used.