Home›Support›English Support›[Resolved] Custom Language always show Content in this language cannot be automatically translated
[Resolved] Custom Language always show Content in this language cannot be automatically translated
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing issues with mapping a custom language code for Chinese Simplified (zh-CN) in WPML. Despite multiple attempts to save the settings, the language showed errors and was not mapping correctly, which prevented automatic translations.
Solution: We recommended the following steps: 1. Ensure a full site backup is created. 2. Replace the function
with a new function that includes a case mapping for 'zh-CN' to 'zh-cn'. 3. Save the changes and verify if the issue is resolved.
This solution might become outdated or may not directly address similar issues due to different configurations or WPML updates. If this solution does not resolve your issue, or if you encounter other problems, please visit our support forum and open a new ticket. We also 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.
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:
I created a new language (Chinese (Simplified)2) for custom code zh-CN, and mapped it to Language mapping in WPML. I saved it multiple times, but that language still shows an error.
"Content in this language cannot be automatically translated unless you map it to a supported language."
Because of that I cannot use the Translation Management for that language.
Symptoms:
Content in this language cannot be automatically translated unless you map it to a supported language.
Questions:
Why does the new language show an error when Language mapping?
I've not seen any supporter assigned to my ticket?
And the problem language is zh-Hans Chinese (Simplified) zh-hans, that is fully supported by WPML. I just edit to have the code zh-CN instead of zh-hans
I took a look at the database and the Chinese (Simplified) that comes with WPML has 'zh_CN' code in the default locale column. So, you have two options here:
- Edit the entry in the database for that particular language and adjust the language code -> These changes can be overwritten when everytime you update the WPML plugins
- Or add a new custom language with a different default local code (different than 'zh_CN') -> This is the recommended option.
So following those topic, in order to create a custom code for the language (hreflang code), I changed the Default locale of the default language (in RED, to zh_CN2), then create a new language (in Blue).
And it work for pt and zh-TW.
I'm perplexed why it just not work for zh-CN. Can you investigate this?
I fixed the hreflang column and it seems that the message under the language mapping is just a false positive. You can see in hidden link -> Language Mappings that it is correctly mapped.
I hope that it is just a false positive, but it's not.
When I use the Translation Dashboard, If I set Chinese (Simplified) as Translate automatically, it will show the lack of mapping error, and not allow me to click Translate (pic1.png)
So I have to set it to Translate myself and I can click Translate (pic2.png). Then I need to go the the Page, and manually using WPML Translation Editor to translate Chinese (Simplified), just that 1 language.
This is just the setup, so I want to make it correctly.
I'm gonna have much more posts and pages. Then having to go through each of them and manually go through WPML Translation Editor is not a good idea.