Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
Plugin strings not translating after WPML default language change.

Solution:
Delete and recreate the translation strings in the WordPress admin dashboard, under WPML → Translations.

  • In WPML → Translations, find the string - you can select domain of your plugin in the "Select strings within domain:" drop-down and use the "Search for:" field and search for part of the string to be translated
  • Select all occurrences of the string and click "Delete selected strings" button - before this please copy the existing translations and save them somewhere for the later step
  • At the bottom of the same page, in "Auto register strings for translation", activate the "Look for strings while pages are rendered" checkbox
  • Reload the front end where plugin is active - plugin code should execute when the page is refreshed
  • Go back to WPML → Translations, clear the "Look for strings while pages are rendered" checkbox, and perform the same search for the string again, it should show up on the list as "Not translated"
  • Insert your saved translation from step 2, save, mark "translation is complete"

The translated string should now show up on the front end.

Relevant Documentation:
https://wpml.org/documentation/getting-started-guide/theme-localization/

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.

This topic contains 2 replies, has 2 voices.

Last updated by marcusR-13 4 years, 6 months ago.

Assisted by: Max.

Author Posts
July 28, 2020 at 2:26 pm #6693613

marcusR-13

Hello,

I’m having problems with the translation of the complianz cookie banner.
The site I’m talking about is bi-lingual (english and german) and I’m using WPML for translations.
When I first installed complianz, I did it while the website’s language in wordpress settings was set to german. So complianz was installed in german, and the problem was, that WPML’S String Translation only recognized the original english String, not the already translated german String.
I couldnt translate string, because it was shown in english, while the cookie banner was in german. Then I uninstalled complianz, set the WordPress site language to english and installed complianz. Now the cookie banner is in english, while WPML correctly recognizes the english strings from complianz.
The problem now is: None of my translations are displayed in the cookie banner.
When I translate from English to German and save the entry, I am shown that the translation was successful, but the cookie banner does not change when I am on the German site.

It would be great if you could help me.
Regards

July 28, 2020 at 9:18 pm #6695635

Max

Hello Marcus,

If I understood correctly, you already made the translations but they are not showing on the translated pages in the front end.

You can try to enable AJAX: in the WordPress admin dashboard under WPML → Languages, scroll down to the "Language Filtering for Ajax" section. Check the box to enable "Store a language cookie to support language filtering for AJAX". Check if your translations show up.

You can also delete and recreate the translation strings in the WordPress admin dashboard, under WPML → Translations.

I will use the "We use cookies to optimize our website and our service." string as example.

  • In WPML → Translations, find the string - you can select "complianz" in the "Select strings within domain:" drop-down and use the "Search for:" field to quickly find it (see screenshot)
  • Select both occurrences of the string and click "Delete selected strings" button (before you do you may want to copy the the translated string and save it somewhere for the later step)
  • At the bottom of the same page, in "Auto register strings for translation", activate the "Look for strings while pages are rendered" checkbox
  • Reload the front end homepage - the Complianz cookie banner should show up
  • Go back to WPML → Translations, clear the "Look for strings while pages are rendered" checkbox, and perform the same search for the string again, it should show up on the list as "Not translated"
  • Insert your German translation, save, mark "translation is complete"

The translated string should now show up on the front end in the Complianz cookie banner.

Useful documentation: https://wpml.org/documentation/getting-started-guide/theme-localization/

delete-translated-strings.png
July 28, 2020 at 11:42 pm #6695881

marcusR-13

My issue is resolved now, thank you! Very good support.