This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to translate strings using WPML and have noticed that the strings are displayed in the original language on the front end, despite being fully translated. The issue persists unless the 'Look for strings while pages are rendered' option is checked. Solution: We have resolved this issue by adding your theme's text domain to be automatically loaded from WPML > Theme and plugin localization. This adjustment should ensure that the translated strings display correctly on the front end without needing to check 'Look for strings while pages are rendered'.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your current setup, we recommend opening a new support ticket. Additionally, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to translate strings using WPML. I have some strings like this: . They are fully translated, but I see all of them on the front end in the original language. I have regenerated .mo files, but nothing has changed. If I check 'Look for strings while pages are rendered', I can see the translated strings on the front end, but when I uncheck it, the issue comes back. Link to a page where the issue can be seen: hidden link
Symptoms:
Strings are displayed in the original language on the front end instead of the translated version.
Questions:
How can I solve the issue of strings not being translated on the front end?
Why do the translated strings appear only when 'Look for strings while pages are rendered' is checked?
Yes, that would need further adaptation of the code to show on the frontend.
Since it is custom-coded not much I can advise, it should work fine, probably there is some issue in your code of the theme or configuration of the theme.
I can advise you to try next:
1) Check if the issue happens without any additional plugins only WPML plugins enabled.
2) Check if the issue happens when using the WP default theme, you can add your string code somewhere random, like header.php, and then translate to check if it works fine.
- Please backup the site files and database before providing us access.
- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.