Skip to content Skip to sidebar

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

Problem: We've added the strings in the code like: We cannot translate it.

Solution: You need to make sure to properly load the text domain in your current theme. Please also ensure it's in lowercase.

Relevant Documentation:

https://developer.wordpress.org/reference/functions/load_theme_textdomain/

https://wpml.org/documentation/support/translating-the-theme-you-created/

https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/

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 3 replies, has 2 voices.

Last updated by Andrey 1 year, 11 months ago.

Assisted by: Andrey.

Author Posts
August 30, 2023 at 9:07 am #14311655

marijnP

Hi,

I'm struggling with a string translation problem. The translations are not visible on the website unless the auto register checkbox is checked (then it works for 2 hours).

I followed almost every forum topic available and tried the following things:

- Disabled all plug-ins
- Tried the published workaround (https://wpml.org/errata/string-translations-are-not-visible-on-the-site-after-a-string-has-been-translated/)
- Pre generated the MO files (https://wpml.org/forums/topic/strings-are-translated-only-when-auto-register-strings-for-translation-is-on/#post-11383577)

The live environment and staging environment do have the same server specs. The problem is present in both environments. The default language is dutch, but the translations don't work in English. You can see the staging site with the following url: hidden link.

Examples of strings that are not translated are:
- Hulp nodig?
- Voor een persoonlijk afscheid

We've added the strings in the code like: <?php echo __('Hulp nodig?','Wikkelgoed'); ?>

Thanks in advance.

August 30, 2023 at 4:12 pm #14315113

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for contacting WPML support.

Are you properly loading the text domain 'Wikkelgoed' in your current theme? Please also ensure it's in lowercase.

For more information, please refer to these links:

https://developer.wordpress.org/reference/functions/load_theme_textdomain/

https://wpml.org/documentation/support/translating-the-theme-you-created/

Before proceeding with any updates, please remember to back up your database first.

August 31, 2023 at 7:43 am #14317811

marijnP

Thank you! That did the trick.

August 31, 2023 at 12:20 pm #14320519

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Nice! Have a nice day 🙂