[Resolved] Frontend language changes after installing WPML plugins
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.
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?
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.
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.
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.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.