This thread is resolved. Here is a description of the problem and solution.
Problem:
You are trying to change the language code of Portuguese (Portugal) from "pt-pt" to "pt" and use it in your site's URL. You encountered issues because the default locale "pt_PT" already exists in WPML's database, preventing you from using "pt" as a custom language code.
Solution:
To achieve your goal, you need to create a new custom language in WPML. However, you cannot directly change the language code for active languages or use a default locale that already exists in WPML's database. Here are the steps you should follow:
1. Access WPML > Languages > Edit Languages to attempt adding a new custom language. Learn more about editing languages
2. Since "pt_PT" already exists, you will need to connect to your database and rename the default locale "pt_PT" in the wp_icl_languages table to something else. This action will allow you to use "pt_PT" as the default locale for your new custom language with the code "pt".
3. Be cautious with direct database modifications as they can affect the connection between original contents and their translations.
Please note that this solution might be outdated or not applicable to your specific case. If this solution does not resolve your issue, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, do not hesitate to 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.
This topic contains 4 replies, has 2 voices.
Last updated by 2 years, 4 months ago.
Assisted by: Andreas W..