This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is unable to change the language code for Chinese from "zh-hans" to "cn" to match the URLs of pages translated manually before installing WPML. Additionally, the client wants to know how to add a custom link to the language switcher.
Solution:
We explained that the language code cannot be changed once it's set. However, we suggested creating a custom language with the desired code "cn" during its creation. For detailed instructions on adding a custom language, we referred the client to our documentation: Editing WPML's Languages Table.
To add a custom link to the language switcher, we advised creating a custom Language Switcher and provided a guide for this process: Custom Language Switcher. Specifically, for adding the custom link with PHP, we directed the client to a section of the guide: The PHP Part.
We also mentioned that if translations already exist under "zh-hans", they can be copied to the new custom language "cn". After copying, the "zh-hans" language can be deleted. For copying translations, we referred to our manual translation guide: Using Different Translation Editors for Different Pages.
Important note!
If there is a subfolder in the WordPress installation with the same name as the custom language code, it will cause issues. We warned against having a subfolder named the same as any of WPML's language codes, as detailed in our guide: Language URL options - Common Mistakes.
If this solution doesn't look relevant, please 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 3 replies, has 2 voices.
Last updated by 1 year, 4 months ago.
Assisted by: Itamar.