This thread is resolved. Here is a description of the problem and solution.
Problem:
You are trying to translate text from a custom JavaScript on your website, but you're unable to do so because the strings are added through JavaScript and not localized.
Solution:
To make the text in your JavaScript translatable, you should use the
wp_localize_script
function. This function allows you to pass PHP variables to JavaScript. For more details on how to implement this, please refer to the WordPress developer resource: wp_localize_script
Additionally, you can find a practical example discussed in our forum here: WPML support forum topic
If you need further customization, we recommend contacting one of our third-party contractors who specialize in custom work with WPML: WPML Contractors
Please note that this solution might be irrelevant if it's outdated or not applicable to your specific case. 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 this does not resolve your issue, please open a new support ticket at WPML Support Forum.
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 0 voices.
Last updated by 1 month, 1 week ago.
Assisted by: Mihai Apetrei.