[Resolved] Adding country code pairs instead of language ISO code
This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to add new custom language pairs using country codes instead of language ISO codes in WPML. Solution: Unfortunately, it is not possible to delete pre-configured languages or add a custom language using the same language code. However, you can modify existing languages. Here are the steps you should follow: 1. Activate the language with the desired language code. 2. Update the language name translations, flag, default locale, hreflang, and language mapping. For detailed instructions on how to edit languages in WPML, please visit Editing WPML's Languages Table.
If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. We also 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. For further assistance, please contact us through the 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.
Could you please upload any relevant screenshots or links that may help clarify your question? I want to ensure I fully understand the issue so I can provide the best possible solution.
For example, if I want to have United Kingdom (uk) it gives an error that the code already exists, this is due to the fact the it is confusing the country code with country language of ukraine, also (uk).
It is impossible to delete pre-configured languages with their language codes or to add a custom language using the same language code; however, you can change them.
Here are the steps:
1. Activate the Ukrainian language.
2. Update the language name translations, flag, default locale, hreflang, and language mapping.
But then I am no able to change the Ukranian Language name to "United Kingdom".
Or does this happens somewhere else?
Yes, however, the name shouldn't appear anywhere else. The language switcher will show the names you added.
I need to have these custom pairs for quite a few countries and many of the reuse the english language. (Canada, USA, Australia, Ireland...).
Any other less "hacky" way of achieving this?
Unfortunately, there is no alternative. I cannot recommend any changes directly to the database as it may lead to potential issues that I cannot predict.
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.