Skip Navigation

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

Problem:
The client wants their URL to include language codes in uppercase (e.g., domain.com/fr-FR/) during the initial setup of the WPML plugin. However, they encounter an error stating that only lowercase letters and '-' are allowed, which prevents them from setting uppercase language codes initially.
Solution:
We explained that all language codes should be in lowercase due to international standards and WordPress conventions. ISO 639 language codes must appear in lowercase, while country codes can be capitalized. The ability to add uppercase letters later in the 'edit language' section is identified as a bug and is scheduled for a fix. We recommend using lowercase language codes to avoid issues with translation files from other plugins and search engines.

If this solution does not resolve your issue or seems outdated, we recommend opening a new support ticket. We also advise 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. For further assistance, please visit our support forum at WPML support forum.

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 1 reply, has 2 voices.

Last updated by Dražen 11 months, 2 weeks ago.

Assisted by: Dražen.

Author Posts
July 3, 2024 at 12:54 pm #15884448

janK-104

Background of the issue:
I want my URL to look like the following domain.com/fr-FR/. The problem is that there is a restriction and it's not possible to create a new language with code that has upper case letters. This is a common format of organizing content many pages follow and it's highly advised by IETF standard. It is possible to create a new language with code that has upper case letters from the language tab. But you can't create a new language with such code during WPML plugin initial page setup (you get the error that only lowercase letters and '-' are allowed). It's important that the initial content will be associated with the default page and will be assigned to it. For sure you can create the desired language later on and just duplicate content but initial content will be assigned to the language set during initialization thus if I remove this language all the posts, products, etc. will be permanently deleted from the database. Maybe there is a way how to reassign those data to the new default language but best would be to assign them from the very beginning.

Symptoms:
There is a restriction and it's not possible to create a new language with code that has upper case letters during WPML plugin initial page setup (you get the error that only lowercase letters and '-' are allowed).

Questions:
Is it possible to create a new language with code that has upper case letters during WPML plugin initial page setup?
Is there a way to reassign data to the new default language if I remove the initial language?

July 3, 2024 at 1:03 pm #15884503

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks for contacting us.

I am afraid that is correct, all language codes should be lowercase, this dues to standards internationally and also standards used in WordPress.

By convention, ISO 639 language codes should appear in lowercase (as opposed to country codes, which are capitalized).

The thing that you can add uppercase later on in the edit language, is actually a bug that is in our queue for the fix in the near future.

We advise you to use lowercase to avoid any issues with translation files from other plugins, search engines and etc.

Sorry, this is not a reply you may have expected, but I am afraid we are just following international standards as mentioned above.

Regards,
Drazen