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 4 replies, has 2 voices.

Last updated by futoshiS 1 year ago.

Assigned support staff: Bigul.

Author Posts
September 28, 2018 at 10:58 am #2773310

futoshiS

Hi,

I would like to insert a custom string in the WooCommerce product description page in order to do auto-translation in the secondary language pages. The string is the short word such as Size or inch etc.

What is the recommended way to do this?

Thank you.

September 30, 2018 at 5:32 am #2776205

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve these issues.

Have you inserted the custom string via code or shortcode? Please share me a couple screenshots for better understanding.

Maybe you can use *wpml_register_single_string* and *wpml_translate_single_string* API for this purpose(to register string for translation and for showing the translated string). Please check the following URLs for more details.

https://wpml.org/wpml-hook/wpml_register_single_string/

https://wpml.org/wpml-hook/wpml_translate_single_string/

--
Thanks!

Bigul

October 1, 2018 at 5:40 am #2777162

futoshiS

Hi,

Thank you for your reply.

Does it work also when I insert the string into the product description field at the Admin Dashboard > Products > Add New page?? You can see the field in the attached file.

I want to insert the text string there in the back-end and do auto translation in secondary language page in the front-end.

Thank you.

October 1, 2018 at 4:53 pm #2778888

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Thank you for the feedback. Please try with [wpml-string] shortcode. It will help you to register the strings. You can translate the string from WPML>>String Translation after visiting the post/page in the frontend. Please check the following documentation for more details.

https://toolset.com/documentation/translating-sites-built-with-toolset/wpml-string-shortcode/

--
Thanks!

Bigul

October 2, 2018 at 2:23 am #2779976

futoshiS

My issue is resolved now. Thank you!