This thread is resolved. Here is a description of the problem and solution.
Problem:
You are trying to translate content on your site, but the translation process is stuck and the changes cannot be seen on the website.
Solution:
We’ve investigated the issue affecting your translation jobs and identified the root cause.
The problem appears to be related to your server’s character encoding settings. Specifically, it looks like the server’s locale is not explicitly set, and it defaults to an older encoding format (ISO-8859-1) instead of the required UTF-8 encoding. UTF-8 is essential for correctly handling Chinese characters.
As a result, when a string such as 圖示清單:文字 (encoded in UTF-8) is processed using the PHP function ucwords, the encoding unexpectedly switches to ISO-8859-1. This causes issues in our logic when generating the XLIFF files used to submit translation jobs. Essentially, this encoding mismatch leads to corrupted data in the translation files, which then prevents translation jobs from being processed correctly and causes them to get stuck (specifically in status 6).
The XLIFF file being generated on your server is improperly encoded with ISO-8859-1.
This leads to corrupted translation units, with the file being abruptly cut off.
The issue stems from the labelize() function in the WPML plugin, which uses ucwords()—a function not suitable for non-ASCII characters like Chinese.
Workaround solution :
We’ve modified our internal utility function to use mb_convert_case() instead of ucwords(), which correctly handles UTF-8 encoding. This change resolves the issue on your site, allowing translation jobs to complete successfully.
Here’s the updated function. Please note that this change was made directly within the WPML plugin files (sitepress-multilingual-cms/classes/utilities/Labels.php)
From :
public static function labelize( $string ) { return ucwords( strtr( $string, [ '-' => ' ', '_' => ' ', ] ) ); }
To :
public static function labelize( $string ) { return mb_convert_case( strtr( $string, [ '-' => ' ', '_' => ' ', ] ), MB_CASE_TITLE, 'UTF-8' ); }
Anyway, our developers have fixed this and an update will be available in the next release.
Please note that the solution provided might be outdated or not applicable to your specific case. We highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, 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 0 replies, has 0 voices.
Last updated by 9 hours, 12 minutes ago.
Assisted by: Kor.