Background of the issue:
I am trying to make my website multilingual using WPML. My website's default language is English, and I have added French and Dutch. My JavaScript was working fine before installing WPML.
Symptoms:
The existing JavaScript script is not working for the added languages (French and Dutch); it's only working on the default language (English).
Questions:
Why is my JavaScript not working for the added languages after installing WPML?
How can I make my JavaScript work for all languages on my multilingual site?
see screenshot for the error I'm getting for the languange dutch (nl). It looks like that WPML does not reload the script with the functions when I change the language (DOM related ?)
Generally the support for custom coding is out of scope of this forum. However, if you can provide some more information about the said code, I'll try my best to help accordingly. For example:
- What does this script do?
- How you're incorporating it in the whole scenario?
- Whether it is part of a plugin or theme?
Besides this, I'll also request to check the following:
1) Take a full backup of your site and database before proceeding. It is highly advised to try these on a dev or staging site first, so your live site isn't compromised.
2) Deactivate all plugins except WPML and String Translation.
3) Switch to a standard theme like 2024 or 2021.
4) Check for the issue if it still happens.
5) Then start activating plugins one by one while keep checking for the issue. This way you 'll be able to pinpoint a conflict when & where it starts creating the problem.
6) If after activating all plugins you see that it still works fine, then switch to your theme and see if that's causing it.
Please let me know your findings and I'll try my best to help you further on the matter.
The script calculates a taxi fare trough a javascript, entered in a piotnet multistepform in elementor. In elementor it's added as a HTML widget, in the HTML widget I entered the javascript code. The script only works on the default language and not on the added WPML languages.