Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 10:00 8:00 – 10:00 8:00 – 13:00 8:00 – 13:00 9:00 – 13:00 -
- 11:00 – 17:00 11:00 – 17:00 14:00 – 17:00 13:00 – 17:00 13:00 – 18:00 -

Supporter timezone: America/New_York (GMT-05:00)

This topic contains 0 replies, has 0 voices.

Last updated by Lauren 1 day, 10 hours ago.

Assisted by: Lauren.

Author Posts
February 19, 2025 at 5:04 pm #16726138

timothyB-8

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.

February 20, 2025 at 1:03 pm #16729636

timothyB-8

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:

[20-Feb-2025 10:19:21 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WP_Error::filter() in /nas/content/live/siemondev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php:189
Stack trace:
#0 [internal function]: WPML\FP\Fns::WPML\FP\{closure}(Object(Closure), Object(WP_Error))
#1 /nas/content/live/siemondev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)
#2 [internal function]: WPML\FP\{closure}(Object(WP_Error))
#3 /nas/content/live/siemondev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Object(Closure), Array)
#4 /nas/content/live/siemondev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(105): WPML\FP\{closure}(Object(WP_Error))
#5 /nas/content/live/siemondev/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(1380): WPML\FP\Left->bimap(Object(Closure), Object(Closure))
#6 /nas/content/live/siemondev/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(790): SitePress_EditLanguages->saveLanguageMapping(Array)
#7 /nas/content/live/siemondev/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(118): SitePress_EditLanguages->update()
#8 /nas/content/live/siemondev/wp-content/plugins/sitepress-multilingual-cms/menu/languages.php(30): SitePress_EditLanguages->__construct(Object(WPML_Flags))
#9 /nas/content/live/siemondev/wp-admin/admin.php(293): include('/nas/content/li...')
#10 {main}
thrown in /nas/content/live/siemondev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php on line 189

February 20, 2025 at 7:25 pm #16731155

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

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.

February 21, 2025 at 4:05 pm #16734528

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

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!