Skip to content Skip to sidebar

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

Problem:
The client installed the WPML bundle to add Russian as an additional language to a WordPress site initially set in English and later switched to Latvian. After installation, all WooCommerce core strings reverted to English, and the WordPress settings showed the site language as English, which was grayed out. The client discovered that the issue was due to a mismatch in the locale code formats used by WordPress, WooCommerce, and WPML.
Solution:
We confirmed that when the WPML Plugin is activated, the WordPress "Site Language" field becomes inactive, and the site's default language should be controlled from WPML > Languages > Site languages. The grayed out "Site Language" in WordPress settings is expected behavior and not a bug. To have the WordPress UI in a different language than the WPML default, each user can set their admin language from the Users > Profile page. For more details, visit Setting the WordPress Administration Language.

If this solution does not resolve your issue or seems outdated, we 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 the problem persists, 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.

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Noman 1 year, 1 month ago.

Assisted by: Noman.

Author Posts
May 29, 2024 at 12:27 pm #15683710

ikB

Background of the issue:
I had initially installed WordPress in English and later switched to Latvian during development. Even modified the woocommerce-lv.po file to fit our needs, as the original translation was still bad. Everything was functioning correctly. I then installed the WPML bundle to add Russian as an additional language.

Symptoms:
Then installed the official WPML bundle in order to have an additional, Russian language on the site. And now all of the core Woocommerce strings are back to English (Add to cart, Buy now, Compare, Wishlist, Login, Register and etc.). The WordPress settings state that the site language is English (grayed out settings option). But the WPML Site Languages section has Latvian as a default, and Russian as a secondary.

Questions:
Could this be due to the fact, that the admin’s language is set to English, and WPML was installed by an admin?
How do we force WordPress and Woocommerce to return, and use Latvian language as a default again, and the tweaked woocommerce-lv.po file again?

May 29, 2024 at 2:58 pm #15684599

ikB

By playing with various settings I have found the culprit of the underlying problem myself.

The reason why Latvian language was not used in the first place, was because of a mismatch in the locale code formats used by WordPress, WooCommerce and WPML. WordPress and WooCommerce identify Latvian simply as "lv" (ISO-639 language code), WPML however as "lv_LV" (ISO 639, AND a ISO-3166 country code).

So by simply changing the default locale value for Latvian language to "lv" under the WPML Edit Languages settings does fix the issue. And the Woocommerce relies on the _lv.po file again and the front-end is displayed in Latvian.

This however does not fix the grayed out Site Language value in the WordPress settings, as it is still remains to be English. So that I believe might be due to a mismatch of the same nature however, somewhere deeper in WPML's components.

A peculiar situation arises however elsewhere. If a default language for an admin user in the WordPress users settings is set to Latvian, the greyed out WordPress site language setting does change to Latvian as well. As if the site language depended on a single user's language... So in a sense, a tottally illogical and confusing behaviour.

I hope I've described the issue in detail, and you can reproduce and address it yourself later on. Please keep me in touch.

Screenshot 2024-05-29 at 17.30.02.png
May 29, 2024 at 7:26 pm #15685296

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

Glad to hear you’ve resolved the WooCommerce language issue.

Regarding the grayed out Site Language issue, When we activate the WPML Plugin, the WordPress "Site Language" field becomes inactive. Instead, we can control the site's default language from WPML > Languages > Site languages. The Settings >> General > Site language field is no longer used, so it doesn’t matter which language is displayed in that field.

If you want the WordPress UI to be in a different language than the WPML default language, each user can set their admin language from the Users > Profile page, as detailed in this doc: https://wpml.org/documentation/getting-started-guide/language-setup/setting-the-wordpress-administration-language/

This setup allows your site to have one default language but you can navigate wordpress backend in any other language you choose.

Does this clarify the system's behavior? To summarize, there is no bug. The WordPress site default language field is inactive when our plugin is activated.

Thank you for your cooperation.