This thread is resolved. Here is a description of the problem and solution.
Problem:
You are inquiring about how to apply language changes to reCAPTCHA and Google Maps when the language change button is pressed, rather than relying on the browser's language settings.
Solution:
For reCAPTCHA, you can manually set the language by adding the "hl" parameter in the reCAPTCHA script URL. Here is an example:
<script src="https://www.google.com/recaptcha/api.js?hl=fr"></script>
Modify the parameter based on the active language using WPML hooks or JavaScript.
Similarly, for Google Maps, to force a specific language, add the "language" parameter to the Google Maps script URL. For example:
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&language=fr"></script>
You can dynamically change this parameter based on the current WPML language.
For more information on WPML Coding API, visit https://wpml.org/documentation/support/wpml-coding-api/.
If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. Also, 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. For further assistance, please contact us through the 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 2 voices.
Last updated by 7 months, 2 weeks ago.
Assisted by: Andrey.