This thread is resolved. Here is a description of the problem and solution.
Problem:
We defined the language and were almost done, but we noticed that we made a mistake with the code of the language. We need to change it so that the permalink goes from this ../pt-br/ to .../pt/.
Please advise how can we correct this.
Solution:
To change the slug of the Portuguese language, we'll need to apply a workaround, which is to create a custom language with the code 'pt'. To do it, please follow these steps:
- Go to WPML -> Languages -> Site languages - > Edit Languages
- Click on the button "Add New Language"
- Add a custom language and make sure that the 'code' is set to 'pt' since this is what shows in the URL. Also, use a different default locale from pt_PT as this is already taken (you can use just pt. Screenshot: https://cdn.wpml.org/wp-content/uploads/2018/02/1516916-Screen_Shot_2018_02_13_at_3.23.21_PM_1.png)
Once the language is added, if you have already created your Portuguese content (pages/posts./etc.), you will need to go to WPML -> Translation Management to duplicate them from the original PT language to your new PT language:
- In the WPML -> Translation Management dashboard, make sure to switch the language to Portuguese, and select content that you want to duplicate
- In "2. Select translation options" duplicate them into the new PT language
After this, you can remove the old PT language in WPML -> Languages -> Site Languages -> Add / Remove languages.
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 2 replies, has 2 voices.
Last updated by 2 years, 9 months ago.
Assisted by: Mateus Getulio.