[Resolved] How to have 2 English language variations EN_US and EN_GB?
This thread is resolved. Here is a description of the problem and solution.
Problem: The client wanted to separate English into en_us and en_gb variations, with en_us as the default language and its URL changed from domain.com to domain.com/en_us/. They also wanted to implement en_gb at domain.com/en_gb/ while keeping all other languages unchanged. Solution: We advised the client that it is not possible to change the language code directly. Instead, we recommended creating custom languages with the en-us and en-gb codes. We instructed the client to: 1. Create a full backup of the database and website. 2. Follow the guide to create the en-us language and duplicate the content to the new language: https://wpml.org/faq/how-can-i-assign-or-change-language-code-to-existing-content/ 3. Add the language with the en-gb code by following this guide: https://wpml.org/documentation/getting-started-guide/language-setup/editing-wpmls-languages-table/#adding-your-own-languages-using-wpmls-gui 4.Kindly note that you'll also need to use a different locale for the en_us language because this locale is already used for the default English language. Please check this errata page Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If so, we 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. If you still need assistance, please open a new support ticket: https://wpml.org/forums/forum/english-support/
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.
We currently have EN as a default language and about 14 other languages. We want to seperate EN to en_us and en_gb variation. We want to implement it in a way that en_us is still a default language but the URL/permalink of that language is changed from domain.com to domain.com/en_us/, while still keeping all posts/pages assigned to that primary language as they are now. At the same time, we would do redirects from domain.com to domain.com/en_us/, so domain.com would not have any function. Additionally, we want to implement en_gb language variation which would mean that it would live on domain.com/en_gb/. All other languages (FR, DE, ES...) should stay intact.
What would be the best and most optimal way to do this?
1. So if I understand this correctly, we need to create 2 new custom languages with those language codes:
- en_gb: This means that the language permalink would be domain.com/en_gb/
- en_us: This means that the language permalink would be domain.com/en_us/
2. After that we need to duplicate the content from the current primary EN language to en_gb and en_us?
3. But what happens with the primary EN language that was sitting on domain.com? Can't this language be available on en_us without any content duplication etc.? Or will the default EN language stay there and we will need to put the redirects to /en_us?
4. Is there any possible way where default language sits on /en_us and the domain.com doesn't have any language function? So basically when you visit domain.com it redirects you to domain.com/en_us by default?
3. The default English language will remain so you need first to switch the default language if needed with the following steps:
- Go to WPML > Language > Site Languages
- Click on "Change Default Language" button and Switch to one of the new languages
- Go to Dashboard > Settings > Permalinks, and resave resave the Permalinks settings
If we follow these steps the default language will be on domain.com/en_us/ and when the user visits the domain.com it will be automatically redirected to domain.com/en_us/, right?
And if he visits some old page or post link for example domain.com/page/ will it be automatically redirected to domain.com/en_us/page/ or do we need to do this with 301 redirects?
When you add the directory to your default language URLs, you must use a root page. This page will be what your site visitors see when they access the domain name, i.e. domain.com