This thread is resolved. Here is a description of the problem and solution.
Problem: The client needed a method to programmatically translate a large number of WooCommerce attribute labels using a third-party API, rather than manually translating each one. Solution: 1. Create a fake product and assign all attributes to it. 2. Send the product for translation. 3. Once translated, delete the product. This method avoids the need for custom scripts by utilizing existing WPML functionality to translate all attributes in bulk. For more details, refer to the documentation on translating taxonomy terms: https://wpml.org/faq/how-to-translate-all-taxonomy-terms-at-once/
If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. Additionally, we 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. For further assistance, please visit our support forum: WPML Support Forum.
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.
Hello i want to translate the woocommerce attribute label programatically either in functions.php or in stand alone script, can you please guide me how to achieve it?
Hi, but we have to manually translate all the fields yes? Isnt there any way we can achieve it programmatically as i am receiving the translations from the third party api and i dont want manual job because there are more than 4000 attributes in the eshop.
I have added the attributes in greek language but now i need to add their translations in english and i believe the above code does not work because i only need to translate all the attributes as all products are already added .
Languages: English (English )French (Français )Arabic (العربية )
Timezone: Pacific/Easter (GMT-06:00)
Hello,
You could actually use that snippet in the following way :
1- Backup your site
2- Add the script from Stackoverflow to your functions.php of your theme
3- Create a new product (if the script worked correctly, this new product will have all the attributes assigned to it)
4- Send that product for translation
5- Translator will get this product along with all the attributes
6- Confirm that everything got translated correctly
7- Delete the new product
8- Remove the Stackoverflow script
Is this method clearer to you now? The script will assign all attributes to your new product and that way you can send it to your translators, a shortcut to get all your attributes translated.
Languages: English (English )French (Français )Arabic (العربية )
Timezone: Pacific/Easter (GMT-06:00)
Hello,
You could translate manually or automatically, both should work.
If you want to translate it yourself, you should be able to do it from WooCommerce > WooCommerce Multilingual & Multicurrency > Products > Click on the + “plus” sign > Translate
You should then see all the attributes listed under the translation editor, similar to this case :
1- hidden link
2- hidden link
---
However, if you want a third party translation service to translate it, you could send it using WPML translation manager and select the product you want to send for translation : hidden link
I have imported all the products through third party api using ICECAT and i have used woocommerce rest api to import products and you are aware that from woocommerce api we cant import the attributes names in secondary language according to this link hidden linkhttps://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/ so i have imported the attribute name in primary language now i need to translate it in the secondary language using the same icecat api as this api provides the translation so i need a custom code or script or api like wooocommerce rest api which translates this attributes names.
Languages: English (English )French (Français )Arabic (العربية )
Timezone: Pacific/Easter (GMT-06:00)
Hello again,
I'm afraid we currently do not have this functionality, and it falls under custom coding,
If I'm not wrong, you are trying to avoid that step: "WooCommerce → WooCommerce Multilingual & Multicurrency. In the Attributes tab, scroll down to the Translations of taxonomy labels and slug section and add the translations."