Google ReCaptcha in another language ?

lcollong

FabriKant d'applications web
Hi,

Can't make reCaptcha element works in another language than english. Both Invisible or Regular. I set "fr" in the language field according to the google setup page but it's calling "recaptcha_en.js". Did I miss something ? Using 3 weeks old github version of Fabrik and Joomla 3.9.1

Thanks,
 
Indeed the regular one is in french.

Using non visible, the captcha.js file requires the recaptcha/api.js with a hl var set to "en" despite my setup (see screenshots) :
JavaScript:
/*! Fabrik */

define(["jquery", "fab/element"], function(e, i) {
    return window.FbCaptcha = new Class({
        Extends: i,
        initialize: function(e, i) {
            if ("invisible" === i.method) {
                var t = this;
                window.fabrikCaptureLoaded = function() {
                    t.widgetId = grecaptcha.render(t.options.element, {
                        sitekey: t.options.siteKey,
                        size: "invisible",
                        callback: t.captureCompleted
                    })
                }
                ,
                requirejs(["https://www.google.com/recaptcha/api.js?hl=en&onload=fabrikCaptureLoaded&render=explicit"])
            }
            this.parent(e, i)
        },

As per the doc (https://developers.google.com/recaptcha/docs/display ) see capture2, it may be better to let this field empty if the fabrik plugin corresponding is empty in order to let the Google choose the right language ?
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    21.4 KB · Views: 141
  • Capture2.PNG
    Capture2.PNG
    30.5 KB · Views: 225
  • Capture3.PNG
    Capture3.PNG
    374.1 KB · Views: 188
  • Capture4.PNG
    Capture4.PNG
    14.4 KB · Views: 140
  • Capture5.PNG
    Capture5.PNG
    18 KB · Views: 298
  • Capture6.PNG
    Capture6.PNG
    368.3 KB · Views: 129
I don't have an invisible captcha enabled.
Did you try to remove
hl=en&
in captcha.js
 
Removing "hl=en" from the url (hard coded) built in captcha(-min).js makes it working in french for invisible as well.
 
I'm using invisible reCAPTCHA v3 and needed to add the following code to fabrik-element-captcha-nocaptcha-invisible.php. Reference: developers.google.com/recaptcha/docs/v3

JavaScript:
<script src="https://www.google.com/recaptcha/api.js?hl=<?php echo $d->lang; ?>&render=<?php echo $d->site_key; ?>"></script>
<script>
    grecaptcha.ready(function() {
        grecaptcha.execute('<?php echo $d->site_key; ?>', {action: 'homepage'});
    });
</script>
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top