Skip Navigation

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

Problem:
The client reported an issue where string translations are correctly present in l10n.php files and the database but are not displayed as translated on the French or German versions of their website. The problem appears randomly, with about 90% of strings correctly translated and 10% remaining untranslated. The client suspects a conflict between l10n.php, .json, and .mo files in the /wp-content/languages/wpml folder.
Solution:
We suggested that the issue might be due to the use of multiple text domains within the same plugin, which can complicate the translation process. WordPress guidelines recommend using a single, consistent text domain per plugin for proper localization. For more details, refer to the official WordPress Plugin Handbook.
Additionally, our second-tier support team advised loading all text domains using the

load_plugin_textdomain

function. Here is an example of how to implement this:

load_plugin_textdomain('leadup-frontend', false, dirname(plugin_basename(dirname(__DIR__))) . '/languages');

load_plugin_textdomain('leadup-admin', false, dirname(plugin_basename(dirname(__DIR__))) . '/languages');

If there are more text domains, they should add new lines accordingly.

If this solution does not resolve the issue or seems irrelevant due to updates or different circumstances, 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. If problems persist, please open a new support ticket.

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 29 replies, has 0 voices.

Last updated by alexandreL-23 1 month ago.

Assisted by: Shekhar Bhandari.

Author Posts
May 22, 2025 at 10:09 am #17060691

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Sure, that should help.

I have enabled the private reply for you.

Thanks

May 26, 2025 at 5:01 am #17070807

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

The login page says "This page has been denied for you by the administrator." Can you please check and fix this.

Thanks

May 27, 2025 at 8:21 am #17076340

alexandreL-23

Hi Shekhar, thanks for your status. We have disabled some additional security layers. Is it possible to test a new time ?

May 27, 2025 at 9:12 am #17076696

alexandreL-23

ok ok

We have enabled your ip address for a week.

Could you retest please?

May 27, 2025 at 9:50 am #17076946

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Can you check the issue now?

I went to hidden link and modified the code from

load_plugin_textdomain(self::I18N_TXT_DOMAIN, false, dirname(plugin_basename(dirname(__DIR__))) . '/languages');

to

load_plugin_textdomain('leadup-frontend', false, dirname(plugin_basename(dirname(__DIR__))) . '/languages');

It seems like you have a few different domains set up within similar plugins. The textdomain was specifically looking for leadup while the textdomain is defined as leadup-core in the leadup-core.php file and in the strings, you’re using leadup-frontend.

I recommend using a single domain within a plugin code to make things easier to manage.

Let me know what you think!

Thanks

May 27, 2025 at 10:40 am #17077340

alexandreL-23

Ok ok I see now ... It partially works, because indeed we do have 4 or 5 domains starting with "leadup-XXXXXX"

When you hardcoded "leadup-frontend", so in the page hidden link, if you test now the process of buying a product in the french site, you should see that some string translations in other domains are not translated...

What you have pin pointed, is a line that is present in one side of our entire site, we are not doing this somewhere else... just there, it's a PHP Class handling our shortcodes, just that. It does not concern the other 99% of our site that has nothing to do related to shortcodes.

Then, the website I gave you is like the staging website. The production version of it, has String translations working properly with this same line... so I think this is a false positive here, that do not affect the entire site.

May 27, 2025 at 11:22 am #17077719

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

For the strings that's not working, can you use a similar text-domain and see if it helps.

The production version of it, has String translations working properly with this same line... so I think this is a false positive here, that do not affect the entire site.

I couldn't understand this, Do you mean the strings works properly on the production site without any additional fix?

Look forward to your reply.

Thanks

May 27, 2025 at 11:26 am #17077788

alexandreL-23

We have 7 WordPress, each of them have 1 staging environment, and 1 production one.

On the 7 production websites, as a not connected user, String translations works, for now...

in the staging website I gave you, String translations does not work. The fix was developed as a fallback, so we are about to publish it on all production websites, because it is a fallback. I mean we think there is a problem not yet revealed in the production ones, and the staging have uncovered it.

Do you see ?

May 28, 2025 at 6:21 am #17081246

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

The issue seems to be related to the use of multiple text domains. WordPress recommends using a single, consistent text domain per plugin to ensure proper localization and translation. If we adhere to this guideline, I don't believe we'll encounter any issues. Would you agree?

You can refer to the official WordPress Plugin Handbook for more details:
https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#text-domains

Thanks

June 2, 2025 at 6:11 pm #17099209

alexandreL-23

Hi Shekhar Bhandari, thanks for your message.

I've read it and it makes to sense to me sorry, we have as a company 12+ sites and domains, with WordPress and WPML in it, since a while we are customers, and basically, you are telling us and our entire IT department, that this issue with String Translations is due to the fact that we use more than one text domain...

WooCommerce, a notorious WordPress plugin we heavily use and be dependent on, use for instance one text domain, which is "woocommerce", and some String Translations of WooCommerce also don't work in this problem... so you are telling that between our proprietary plugins, which also use their own text domain, and WooCommerce, we do have to make a choice and remove them ?

Absolutely no, there is no way to accept that as an answer, we cannot do that as a generating profits business. That's not acceptable, if we do have +15 plugins, making available in WPML String Translations +15 different text-domains, we cannot remove entirely one or two plugins, just in order to reduce the total amount of text domains handled by WPML.

Time is ticking, we will have to remove your access, the issue is still present, please do refer this entire topic to someone from the dev department please, I got pressure from my management to solve this ASAP. We are a paying customer, we are not playing here.

June 3, 2025 at 9:15 am #17101065

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I have asked feedback from our 2nd tier supporters and they suggested to load all the textdomains using load_plugin_textdomain

So on hidden link

Add as following

load_plugin_textdomain('leadup-frontend', false, dirname(plugin_basename(dirname(__DIR__))) . '/languages');
		load_plugin_textdomain('leadup-admin', false, dirname(plugin_basename(dirname(__DIR__))) . '/languages');

if you have more text-domains, please add new lines accordingly and it should help.

Look forward to your reply.

Thanks!

June 3, 2025 at 1:10 pm #17102428

alexandreL-23

Thanks for your prompt reply Shekhar,

Ok I will transmit internally that suggestion, and test it.

Please allow me 72 hours to come back to you here with a status. Please do not close the ticket.

See you

June 4, 2025 at 6:44 am #17104555

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Sure, will wait for your feedback.

June 5, 2025 at 10:18 am #17109542

alexandreL-23

After many tests, you latest suggestion works like a charm. Excellent, thank you for all Shekhar.

June 6, 2025 at 7:07 am #17112957

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Glad to know that. 🙂