1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Google ReCaptcha in another language ?

Discussion in 'Community' started by lcollong, Jan 14, 2019 at 11:02 AM.

  1. lcollong

    lcollong FabriKant d'applications web

    Level: Community
    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,
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
  3. lcollong

    lcollong FabriKant d'applications web

    Level: Community
    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) :
    Code (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 ?
     

    Attached Files:

  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    I don't have an invisible captcha enabled.
    Did you try to remove
    hl=en&
    in captcha.js
     
  5. lcollong

    lcollong FabriKant d'applications web

    Level: Community
  6. lcollong

    lcollong FabriKant d'applications web

    Level: Community
    Removing "hl=en" from the url (hard coded) built in captcha(-min).js makes it working in french for invisible as well.
     

Share This Page