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.

This topic contains 1 reply, has 2 voices.

Last updated by Dražen Duvnjak 1 year ago.

Author Posts
February 27, 2023 at 4:10 pm #13126921

ivanR-40

Hello,

I have a plugin which contains translatable strings in javascript like forexample:

_x('Write your message', 'Reply area placeholder', 'bp-better-messages');

This text shows up on the string translation page, but it doesn't get translated. The plugin dev says the translation plugin, WPML, needs to support string translation from javascript.

How do I translate these javascript strings ?

Thank you.

February 28, 2023 at 6:53 am #13131375

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

Please make sure you are following our guides and also that you are following WordPress's instructions on how to localize scripts.

https://developer.wordpress.org/reference/functions/wp_localize_script/

https://wpml.org/documentation/support/enabling-text-translation-for-themes-not-compatible-with-wpml/

Please note that we currently are not able to provide support for custom work within this forum. I will, however, try to point you in the correct direction.

Hope it helps, let us know how it goes.

Kind regards,
Drazen

The topic ‘[Closed] How to translate javascript strings?’ is closed to new replies.