Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Europe/Madrid (GMT+02:00)

This topic contains 10 replies, has 1 voice.

Last updated by viktorsL 5 hours, 48 minutes ago.

Assisted by: Marcel.

Author Posts
November 24, 2025 at 10:06 pm #17606299

viktorsL

Background of the issue:
I am trying to translate some of the strings on my website, which is set to Latvian language using WPML. I installed WooCommerce, and WooCommerce shows its strings as English on the string translation page. I have added translations to the strings there, but they are not being applied on the website. I customized the WooCommerce template and wrote code like: <div id="payment" class="woocommerce-checkout-payment"> <div class="title"> <h2><?php esc_html_e('Maksājuma metodes', 'woocommerce'); ?></h2> </div> .... After which, I would go to string translation and change the 'Maksājuma metodes' string default language from English to Latvian and then translate this string back to English, and now it works.

But when I translate strign that has default language of english to latvian it does not get shown on the frontend on latvian language of the page. Another language like russian works well for this translated english string. but not for latvian which is the default language of my website...

Symptoms:
Translations added to WooCommerce strings are not being applied on the website if the default language of the string is set to english and is translated to latvian.

Questions:
Is there any other way to translate WooCommerce strings without creating custom templates?
Why are the translations not being applied even after adding them in the string translation page when translating from default string language to pages default language?

November 24, 2025 at 10:40 pm #17606403

viktorsL

strings liek - Your cart is currently empty. is still not translatedd to default language.

November 25, 2025 at 11:33 am #17607765

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

I would eventually also need to request temporary access (WP-Admin and FTP) to your site
– preferably to a test site where the problem has been replicated if possible –
in order to be of better help and check if some configurations might need to be changed

Your next answer will be private which means only you and I have access to it.

❌ Please backup your database and website ❌

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

✙ Please add the Links to the […] Edit Screen, the Page/Post where you insert the […] and the corresponding Front End Page/Screen

Best Regards,
Marcel

November 26, 2025 at 5:38 am #17610170

viktorsL

The link to a page is a cart page - hidden link
Edit page - hidden link

November 26, 2025 at 4:30 pm #17612886

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

could you please try clearing the contents of /wp-content/languages on your staging environment and check whether the files are regenerated afterward?
It looks like the translations exist but aren't being fetched correctly.

Best regards,
Marcel

November 26, 2025 at 8:00 pm #17613230

viktorsL

I did it and also cleared cache and things. it did not help

November 26, 2025 at 10:45 pm #17613519

viktorsL

Can it be related if I use custom plugin that overrides cart-empty.php using:
add_filter('woocommerce_locate_template', [$this, '_custom_plugin_locate_template'], 99999, 3);

and then in override cart-empty.php with something like:
do_action( 'woocommerce_cart_is_empty' );

so the string is pulled from woocommerce in my custom plugin and thus can potentially be untranslatable to default language? Or it must work anyway?

November 26, 2025 at 11:09 pm #17613547

viktorsL

Maybe there is some way to use correct context of the language when calling actions or variables from woocommerce inside my custom overriden files, like language specific:
do_action( 'woocommerce_cart_is_empty' ); or some other approach?

November 27, 2025 at 5:56 am #17613793

viktorsL

I also tried removing the custom templates from the plugin so it uses woocommerce templates and still english version appeas on front, even though default is latvian.

November 27, 2025 at 6:22 am #17613798

viktorsL

I tried translating other plugins, tried also disabling plugins, reanabling them but it did not work. When the default language domain for string is set to English and it is translated to Latvian and my website is in Latvian as default language it just does not work. Strings still displayed in default string language for default webpage language. When I choose any other language (secondary) - all works well...

November 27, 2025 at 4:30 pm #17615985

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

please provide a duplicator package of your site for local debugging: https://wpml.org/de/faq/provide-supporters-copy-site/.

Thanks!

Best Regards,
Marcel