• Resolved nzapponi

    (@nzapponi)


    Hello,
    Would it be possible for you to update the plugin so that it requests the NoCaptcha ReCaptcha in the correct language?

    The edit to make is literally two lines long:
    In

    google-no-captcha-recaptcha/public/includes/contact-form-7/class-wdm-contact-form-7-public.php

    Replace the following line:

    wp_register_script( 'google-nocaptcha-recaptcha-api', "{$protocol_to_be_used}www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit", array( 'wdm_render_recaptcha' ), '1.0.0', false );

    with:

    $lang_code = substr(get_bloginfo ( 'language' ), 0, 2);
    wp_register_script( 'google-nocaptcha-recaptcha-api', "{$protocol_to_be_used}www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit&hl={$lang_code}", array( 'wdm_render_recaptcha' ), '1.0.0', false );

    Thank you very much.
    Nick

    https://www.ads-software.com/plugins/google-no-captcha-recaptcha/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WisdmLabs

    (@wisdmlabs)

    Hi nzapponi,
    Thanks for the support, we will try this out and include it in our next update.
    Thanks again ??

    Can I update this?

    I found very useful to have the Recaptcha module displayed in the user language, based on the site language.
    I only improved a little the solution of nzapponi

    On
    admin/google-recaptcha-nocaptcha.php
    You can simply add on the top of the languages array:
    'auto' => __( 'Auto (site based)', 'google-nocaptcha-recaptcha-locale' ),

    On
    public/includes/contact-form-7/google-recaptcha-nocaptcha.php
    Find:

    if ( $language_code == "" ) {
    $language_code = "en";
    }

    And add this just after that:

    elseif ( $language_code == "auto" ) {
    $language_code = substr(get_bloginfo ( 'language' ), 0, 2);
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Localized NoCaptcha Recaptcha request’ is closed to new replies.