Skip Navigation

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.

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 5 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
July 31, 2023 at 11:00 am #14126227

mikeG-21

Hello,

We have a problem with String translations. When we use a custom string domain on some custom templates (pages, posts...), some translations of strings in random languages disappear from the front end. However, when we check the string translations, the translations are still there, but they are not showing on the front end. The issue can be fixed by saving the affected string translation again. Usually, multiple string translations disappear from the front end and revert to the default English language. However, when we save just one string translation from the same domain, it fixes all the missing translations that are part of that custom string domain.

We are unable to identify what is causing this problem, as it happens randomly without any specific pattern. I have tried to replicate the issue by adding new translations, removing them, and adding new strings to translate in that domain, but I have had no luck in reproducing it. Currently, we don't have any problematic strings, but they might appear again soon. Do you have any idea what could be causing this issue?

I suspect it might be a conflict in how the string translations are being saved to the database, possibly due to our large database size, which is causing it to stop working for custom strings.

Thank you for your assistance. Regards.

July 31, 2023 at 11:01 am #14126233

mikeG-21

I also managed to record the issue: hidden link

August 1, 2023 at 8:26 am #14131285

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Mike,

Thank you for contacting the support.

This sounds a strange problem while I believe if you are using proper text domains and gettext calls, it shouldn't happen.

However, assuming that this is happening in your custom theme, I'll recommend trying to set these domains in WPML -> Theme and plugins localization -> Theme and plugins localization -> Automatically load the theme's .mo file using 'load_textdomain' option (see attached).

And see if that helps.

On the other hand, I'll also advise to check https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/ and try to scan your theme and/or plugins (having those strings) once. This way WPML scans the selected theme/plugins and registers the strings in String Translation.

Also make sure these strings are "included in string translation" via "Translate text in admin screen" (hidden link), in case if these appear in admin texts.

Please let me know if this helps.

Regards.

Screenshot 2023-08-01 131928.jpg