6. String translations
String translations in WordPress refer to the translation of text strings embedded in the code of themes and plugins. These can be texts displayed on the front-end or in the admin area of the site. Think of buttons, error messages, labels, menu items and other text that the user sees and needs to understand. An example of this is the text below in my own plugin. This text The base language of WordPress is English and the ‘group’ of translations belongs to the ‘wpmula’ plugin.
Add translation
1. Search for the string your want to translate
For example you want to translate a string that contains the word ‘example’. Then you input ‘In a few words’ in the search field en get some results. In the first column ‘Source’ you will see the ‘source’ text, the original text. In the second column ‘Default translation’ you will see the current translation. In the third column ‘Custom translation’ you can put in your own translation (by default filled with the ‘default’ translation). If you want to save your ‘Custom translation’, click on ‘Save custom translation’.
2. In this example we will translate the second row in the results. As you can see in the image below, i added the words ‘My custom translation.’.
3. After clicking on ‘Save custom translation’ the translation will be visible on the end of the page. And you will see a succes message on top of the page.
4. The translation will be visible on the place where it is used. In this example it is visible in WordPress ‘General’ settings page.
Update translation
Update a translation is very easy, you can do exactly the same as for adding it. If you change the translation, search for it. The only difference is the ‘Update custom translation’ button, so you can see your are ‘updating’ (not adding).
Remove translation
Removing a translations completly is a simple action. Just scroll to your translation and click on ‘Remove translation’ to remove it.