Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 4 replies, has 1 voice.

Last updated by Waqas Bin Hasan 4 months, 2 weeks ago.

Assisted by: Waqas Bin Hasan.

Author Posts
March 7, 2025 at 11:10 am #16787706

fouadM-5

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?

March 7, 2025 at 11:31 am #16788036

fouadM-5

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 ?)

Screenshot_1.jpg
March 10, 2025 at 9:17 am #16795155

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

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.

Regards.

March 11, 2025 at 9:48 am #16800516

fouadM-5

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.

March 11, 2025 at 1:31 pm #16801977

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

Have you tried in a minimal setup as requested earlier?

Other than that, I'll recommend adding that script directly to a page, code or HTML widget (than in Elementor) and see if that works fine with WPML.

The topic ‘[Closed] javascript is not working with other language than the default language’ is closed to new replies.