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 2 replies, has 1 voice.

Last updated by mauriziob-3 1 month, 1 week ago.

Author Posts
May 27, 2025 at 3:15 pm #17079350

mauriziob-3

Background of the issue:
I'm using the Enfold theme for a hotel website. The pages have a JavaScript code for the reservation system. I used to put this code in a text element and translate it in string translation to change the language variable (i.e. it-IT for Italian, en-GB for English, etc.).

Symptoms:
I can't find those strings for translation anymore, even though this method used to work earlier. I also tried the Enfold code element but had no luck.

Questions:
Why can't I find the strings for translation anymore?
Is there an alternative method to translate the JavaScript code in the Enfold theme?

May 28, 2025 at 6:51 am #17081382

mauriziob-3

Anyone?

May 28, 2025 at 7:05 am #17081493

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Welcome to the WPML support forum. Before passing this thread to my colleague, I would like to share some suggestions and possible solutions for the issues you mentioned.

Please make sure you are following our documentation as well as WordPress’s guidelines on how to localize scripts.

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

https://wpml.org/errata/translating-strings-from-javascript-files-using-wp_set_script_translations/

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

--
Thanks!

Bigul

May 28, 2025 at 10:16 am #17082750

mauriziob-3

Solved with ChatGPT