This thread is resolved. Here is a description of the problem and solution.
Problem:
You are trying to translate WooCommerce product attributes for different products where the attribute 'Size' has numerical values. However, these values are not appearing in the Translation Editor, and the WooCommerce > WooCommerce Multilingual > Attributes tab is empty because the attributes were set manually and not as global attributes.
Solution:
To translate numerical values in product attributes, you need to add a specific code snippet to the functions.php file of your theme. Here is the code you should add:
function wpmlsupp_7499_allow_translating_numbers($is_translatable, $job_translate) {<br /> $data = $job_translate['field_data'];<br /> if ('base64' === $job_translate['field_format']) {<br /> $data = base64_decode($data);<br /> }<br /> if (is_numeric($data)) {<br /> return true;<br /> }<br /> return $is_translatable;<br />}<br />add_filter('wpml_tm_job_field_is_translatable', 'wpmlsupp_7499_allow_translating_numbers', 10, 2);
After adding this code, make a minor change to the product, save it, and update the translation. In the Translation Editor, manually search for the number you wish to translate. Ensure that the translation preference for the field where you're adding the numerical value is set to 'Translatable' in WPML > Settings > Custom Field translation.
If you're using custom attributes not created through the WooCommerce > Attributes section, consider creating global attributes for easier management and translation.
If this solution does not resolve your issue or seems outdated, we 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. If needed, please open a new support ticket at WPML support forum for further assistance.
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 2 months ago.
Assisted by: Prosenjit Barman.