Background of the issue:
I recently upgraded to version 4.7 of WPML. I want to change our current simplified Chinese language folder from /zh-hans/ to /zh/. Prior to version 4.7, it seemed necessary to create a new version of simplified Chinese and copy over the content from the old one to use /zh/. However, this does not seem possible in version 4.7.
Symptoms:
I am unable to change the language folder for simplified Chinese from /zh-hans/ to /zh/ in WPML version 4.7.
Questions:
Is there a known way to change the language folder from /zh-hans/ to /zh/ in WPML version 4.7? Also, we plan to use AI translation for the Chinese site (and several other languages too). I just want to make sure this won't affect that either.
So, with the help of our developer we've turned off our custom theme and are using the default 2023 theme. We've deactivated all plug-ins except WPML and we tried adding the Portuguese with a code of PT (this is something we needed to do in addition to changing our Chinese path to /ZH/), but still got the following error:
Please make sure you are using the latest version of WPML plugins. Go to Plugins -> Add New -> Commercial and click Check for updates and update any as needed.
With minimal settings, please be sure to make a full backup of your site and database.
Then, go to WPML -> Support -> Troubleshooting.
Look for 'Clean up' and click the following:
- Synchronize posts taxonomies
- Clear the cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Set language information
- Synchronize local job IDs
- Fix Terms count
- Fix post assignment for translations
If that does not resolve the issue, I'd like to request credentials so that I can login and take a closer look. The next reply will be marked as private so that you can share login details in the included private fields.
I logged in to the test site and the first thing I saw was the message from WPML asking if the site was a copy or moved. I marked it as a copy, as this banner not being resolved could be related to the error. I then went to WPML -> Languages -> Edit languages and mapped both Chinese languages. I then attempted to add a custom pt language, but got the message that the locale already exists. Sure enough, the standard locale for Portuguese (Portugal) is pt. WPML will not allow you to create a custom language with the same language code that already exists in the database. So you can either create a custom language with something other than pt, or you can use the standard Portuguese (Portugal) language. I was not able to recreate any fatal errors with these steps. Please let me know if there is something else you are doing that is causing the error, and what steps I should take to reproduce it. Thanks!