Home›Support›English Support›[Resolved] Switching content languages / language codes to corresponding language
[Resolved] Switching content languages / language codes to corresponding language
This thread is resolved. Here is a description of the problem and solution.
Problem: The client installed WPML for a bilingual website (Croatian and English), but the default language was incorrectly set as English, causing the English content to appear under the Croatian extension (/hr) and vice versa. Additionally, the client attempted to manually switch language codes and flags, which partially resolved the issue, but the English content still appeared under the wrong extension (/hr instead of /en).
Solution: We advised against changing the main language of the site due to potential data loss and complications. Instead, we recommended restoring the site to a state before these changes were made to properly assess and correct the settings. This should be done in a staging environment to avoid further issues. We corrected the flags and language names to ensure they match the correct languages. We also confirmed that the client used the Classic Translation Editor (CTE) and noted that if switching to the Advanced Translation Editor (ATE) is necessary, all content must be retranslated as the editors are not interchangeable.
If this solution does not resolve your issue or seems outdated, 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 problems persist, please open a new support ticket 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.
Background of the issue:
The original web content is in Croatian. I was going to add the English translation. Installed WPML, but it automatically set that original content is in English (which it isn't) and after adding the translation, it was messed up (switched): myweb.com in English, and myweb.com/en in Croatian language - (it should be the opposite). Tried to change default language and solve/hack the solution with edit languages (switching codes and flags), and almost succeeded.
Symptoms:
Clicking on Croatian flag leads to hidden link - Croatian content, that's fine. Clicking on English flag leads to hidden link - English content as it should, but wrong extension - /hr instead of /en.
Questions:
How can I change the extension to /en, instead of /hr?
What do you suggest as the simplest solution to fix this?
Languages: English (English )Portuguese (Brazil) (Português )
Timezone: America/Sao_Paulo (GMT-03:00)
Hello there,
Thank you for reaching out. Changing the main language of your site is not recommended as it can lead to data loss and other complications. It's crucial to perform such changes in a staging environment first to understand the impacts.
I was able to revert the flags and language names, ensuring Croatian has the correct flag and name. The English content is opening in the Classic Translation Editor (CTE) rather than the Advanced Translation Editor (ATE), can you confirm if you used the classic translation editor to translate your content or this might be a bug?
The best way to proceed would be to restore your site to the point before the main language was changed. This will allow us to review the settings and understand what caused the language mix-up that you reported. Make any changes in a staging environment to ensure there are no unexpected issues. Also, ensure the correct translation editor is being used for your content. If you need to use ATE, you might need to retranslate the content using ATE given that both translation editors are not interchangeable, if you switch from one to other the texts need to be translated once more.
Yes confirmed I use classic translation editor.
After your fix languages were correctly (re)directed and I manage to fix just by adding again some missing translations.
Menus were not syncing, english one shows some specific fixed menu (not the translated croatian versions), but I just added english pages to that one so it's all fine now, no need to fix.
Languages: English (English )Portuguese (Brazil) (Português )
Timezone: America/Sao_Paulo (GMT-03:00)
Hello there,
I'm afraid that the credentials get removed from the ticket after it gets marked as resolved due to security reasons.
Can you try the following procedure after making a full new backup of the site?
- Temporarily make English the main language of the site in WPML > Languages
- Go to WPML > Settings > Media Translation
- Check the option 'Duplicate existing media for translated content' and 'Duplicate the featured images for translated content'
- Click on start
- Make Croatian the main language again in WPML > Languages and check if the issue is fixed
Please let me know if the issue persists after that so I can enable the private fields for you to share the access to the site once more.