Translate non-dynamic strings in Hestia?
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 present an example of such situations by using the blog page of Hestia Pro:
🗂️Table of content
🔃 Translation using Poedit
Step 1:
Install the Poedit plugin, using these instructions.
Step 2:
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.
Step 3:
Open the hestia-pro.pot file with Poedit.
Step 4:
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.
Step 5:
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.
Step 6:
Now you should have both .po and .mo files for the desired language in the theme files languages directory.
Step 7:
Open the .po file for desired language using Poedit.
- In this case, it is ro_RO.po file.
Step 8:
Here you have to search for the desired string and in the bottom panel of Poedit, you can write the translation for it.
Step 9:
After you wrote all the translations save the .po file.
💡Result:
Refresh the website and look for the chnages.
🌐 Translation using Loco Translate
Step 1:
Install the Loco Translate plugin, using these instructions.
Step 2:
Navigate to Dashboard > Loco Translate > Themes and select the Hestia Theme.
Step 3:
Click on the New language button, to configure it.
Step 4:
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.
Step 5:
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.
Step 6:
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".
💡Result:
Refresh the website and check if the strings have been translated.