This thread is resolved. Here is a description of the problem and solution.
Problem:
The client has a Google review widget on their website, translated into four languages using different JavaScripts for each language. They face an issue where every time the page is updated, the JavaScripts for other languages revert to the main language, requiring manual adjustments each time.
Solution:
We recommend not using JavaScript code in the glossary as WPML does not support translating JavaScript natively. Instead, you can use WPML's filters and action hooks to manage multilingual support. Here's how you can proceed:
1. Remove the JavaScript code from the glossary.
2. Write custom code to detect the current language and insert the appropriate JavaScript code. You can find guidance on this through the following documentation links:
If you need professional help to implement this, consider hiring a WPML-certified contractor from this list.
If this solution does not apply to your case, or if it seems outdated, 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. If issues persist, please open a new support ticket.
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 1 voice.
Last updated by 1 week, 3 days ago.
Assisted by: Carlos Rojas.