Translate non-dynamic strings
This documentation should help you translate non-dynamic strings. A non-dynamic string is a string that you can't change from the customizer.
This article will be present an example of such situations, by using the blog page of Hestia Pro:
🗂️Table of content
🔃Translation using Poedit
Take a look at the theme files and find the .pot file.
📝 Note: For example, in Hestia Pro, you will find it in /languages/hestia-pro.pot.
Open the hestia-pro.pot file with Poedit.
Now you have to generate .po and .mo files for each language that you want to translate your site.
- I will generate them for Romanian.
Click File > Save as and name the file with this format depending on the language code of 2 letters.
- For Romanian is ro_RO and for English is en_EN.
- You can check the WP Locale code here.
📝 Note: Make sure to save the .po file in the theme files languages directory.
Now you should have both .po and .mo files for the desired language in the theme files languages directory.
Open the .po file for desired language using Poedit.
- In this case, it is ro_RO.po file.
Here you have to search for the desired string and in the bottom panel of Poedit, you can write the translation for it.
After you wrote all the translations save the .po file.
Refresh the website and look for the chnages.
🌐Translation using Loco Translate
Navigate to Dashboard > Loco Translate > Themes and select the Hestia Theme.
Click on the New language button, to configure it.
Once the new window appears, you have to choose two things:
- Choose a language - WordPress language or custom language ( the language of the entire website ), eg. English.
- Choose a location - the System location prevents it from being erased in case of an update.
Click on the Start Translating button.
Soon, the whole theme will be loaded as strings. In order to translate the "Read more" strings, in the Filter translating field, type the string and select it from the list.
In the textbox from the bottom of the page ( English translations ), enter the translation of the string, that you want to be displayed instead of "Read more".
- I have entered the Romanian translation, "Citeste mai mult".
Refresh the website and check if the strings have been translated.