? Failure

User tests: Successful: Unsuccessful:

avatar Robdebert
Robdebert
13 Jun 2016

Pull Request for Issue #10809

Summary of Changes

plugins\captcha\recaptcha\recaptcha.php -> at line 64.
changed JFactory::getLanguage()->getTag() to

$lang = JFactory::getLanguage()->getTag();
$lang = explode("-", $lang);
$lang = $lang[0];
$file ='https://www.google.com/recaptcha/api.jsonload=JoomlaInitReCaptcha2&hl='.$lang.'&render=explicit';

Testing Instructions

See the Issue for testing / reproducing instructions: #10809

avatar Robdebert Robdebert - open - 13 Jun 2016
avatar Robdebert Robdebert - change - 13 Jun 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Jun 2016
Labels Added: ?
avatar Robdebert Robdebert - change - 13 Jun 2016
Title
#fixes https://github.com/joomla/joomla-cms/issues/10809
reCaptcha does not work for severeal languages. #fixes https://github.com/joomla/joomla-cms/issues/10809
avatar Robdebert Robdebert - change - 13 Jun 2016
Title
#fixes https://github.com/joomla/joomla-cms/issues/10809
reCaptcha does not work for severeal languages. #fixes https://github.com/joomla/joomla-cms/issues/10809
avatar Robdebert Robdebert - change - 13 Jun 2016
Title
reCaptcha does not work for severeal languages. #fixes https://github.com/joomla/joomla-cms/issues/10809
reCaptcha does not work for some languages. #fixes https://github.com/joomla/joomla-cms/issues/10809
avatar Robdebert
Robdebert - comment - 13 Jun 2016

Btw: the PHP 5.6 Travis-CI Build always fails, because it still uses "mysql" instead of "mysqli" - can someone please fix this?

avatar brianteeman brianteeman - change - 13 Jun 2016
Title
reCaptcha does not work for severeal languages. #fixes https://github.com/joomla/joomla-cms/issues/10809
reCaptcha does not work for some languages. #fixes https://github.com/joomla/joomla-cms/issues/10809
avatar brianteeman brianteeman - change - 13 Jun 2016
Title
reCaptcha does not work for some languages. #fixes https://github.com/joomla/joomla-cms/issues/10809
reCaptcha does not work for severeal languages. #fixes https://github.com/joomla/joomla-cms/issues/10809
avatar brianteeman brianteeman - change - 13 Jun 2016
Category Plugins
avatar mbabker
mbabker - comment - 13 Jun 2016

The deprecation notices do not cause failures. The Travis-CI environment tests all database engines that the platform supports (the legacy ext/mysql, ext/mysqli, pdo_mysql, and ext/pgsql) and the deprecation handler exists to catch these and block them from causing a PHPUnit warning, error, or failure.

avatar brianteeman
brianteeman - comment - 13 Jun 2016

The travis errors are at the bottom

FOUND 8 ERROR(S) AFFECTING 4 LINE(S)

69 | ERROR | Please start your comment with a capital letter; found "//
| | returns da-DA or en-GB"
71 | ERROR | Please start your comment with a capital letter; found "// is
| | "da" or "en" only."
71 | ERROR | Whitespace found at end of line
72 | ERROR | Concat operator must be followed by one space
72 | ERROR | Concat operator must be preceeded by one space
72 | ERROR | Concat operator must be followed by one space
72 | ERROR | Concat operator must be preceeded by one space
73 | ERROR | Whitespace found at end of line

avatar Robdebert Robdebert - reference | fd6a1d4 - 13 Jun 16
avatar Robdebert
Robdebert - comment - 13 Jun 2016

@brianteeman Fixed your messages: fd6a1d4

avatar brianteeman
brianteeman - comment - 13 Jun 2016

Reading the doc https://developers.google.com/recaptcha/docs/language doesnt this mean change that for some languages (english, chinese, french, portuguese) the wrong text will be displayed

avatar Robdebert
Robdebert - comment - 13 Jun 2016

@brianteeman I checked your note. And the only exception is for chinese, where "zh" is not available. All other languages do work without the country-code addon.

So i added "zh" as an exception and use the joomla-language-tag instead. See 3rd Commit.

avatar brianteeman
brianteeman - comment - 13 Jun 2016

But for example you are now displaying US English to users of en-GB, en-AU, en-US, en-CA - captcha works but not in the correct language.

avatar Robdebert
Robdebert - comment - 13 Jun 2016

Yes, but i assume that all amercian and all british users will be able to read and understand the text.

At last for "german" in all the german-speaking countries it does not matter if you are from germany, switzerland or austria - the text is always the same.

I guess that for all the other lanugage in different countries it will be the same.
Otherwise we might need a reCaptcha-specific localisation with language-keys in the joomla-system-language and all its translations.

avatar brianteeman
brianteeman - comment - 13 Jun 2016

Never assume anything.

On 13 June 2016 at 15:08, Robert Heine notifications@github.com wrote:

Yes, but i assume that all amercian and all british users will be able to
read and understand the text.

At last for "german" in all the german-speaking countries it does not
matter if you are from germany, switzerland or austria - the text is always
the same.

I guess that for all the other lanugage in different countries it will be
the same.
Otherwise we might need a reCaptcha-specific localisation with
language-keys in the joomla-system-language and all its translations.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#10810 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABPH8SjnhsyiV3jOxJRMTqdfmqvuuCAuks5qLWRlgaJpZM4I0T90
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar Robdebert
Robdebert - comment - 13 Jun 2016

What is your suggestion then? As far as i know it makes no difference in which country you live when using a translation. Or does it?

avatar brianteeman
brianteeman - comment - 13 Jun 2016

Without applying the patch
I just set my language to da-DK and setup recaptcha and when resetting the password I correctly get the message "I'm not a robot" in Danish

tu49

Viewing the source shows that the following is being passed

https://www.google.com/recaptcha/api.js?onload=JoomlaInitReCaptcha2&render=explicit&hl=da-DK

When following that I can see that google understand that it should use

https://www.gstatic.com/recaptcha/api2/r20160606115301/recaptcha__da.js

So it all looks like it is working correctly to me without any patch

avatar infograf768
infograf768 - comment - 15 Jun 2016

What may happen for the languages with 3 letters code? We have a few for Joomla

avatar piotr-cz
piotr-cz - comment - 15 Jun 2016

There could be a mapping of Joomla languages to reCaptcha library supported ones, like

/**
 * Map of Joomla! language tags to Google reCaptcha supported languages
 */
protected static $languagesMap = array(
    'cs-CZ' => 'cs',
    'pt-BR' => 'pt-BR',
    'pt-PT' => 'pt-PT',
    'zh-CN' => 'zh',
    //...
);

//...
public function onInit($id = 'dynamic_recaptcha_1')
{
    //....
    $joomlaLangtag = JFactory::getLanguage()->getTag();
    $googleLangtag = 'en';

    if (isset(static::$languagesMap[$joomlaLangtag]))
    {
        $googleLangtag = static::$languagesMap[$joomlaLangtag]
    }

    $file = 'https://www.google.com/recaptcha/api.js?onload=JoomlaInitReCaptcha2&hl=' . $googleLangtag . '&render=explicit';
}

avatar infograf768
infograf768 - comment - 15 Jun 2016

@piotr-cz
No one knows which languages will be available. The list is not limited to the registered languages.
With com_localise I can make any new packs with any tag.

avatar brianteeman
brianteeman - comment - 15 Jun 2016

My test above shows that this code is not needed. It works fine as it is

avatar brianteeman
brianteeman - comment - 16 Jun 2016

Can anyone else confirm that their is a problem with the current code using a language such as Danish as it worked perfectly for me.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10810.

avatar piotr-cz
piotr-cz - comment - 16 Jun 2016

There is no problem with polish language, tested on v3.5.1

avatar brianteeman
brianteeman - comment - 27 Jun 2016

@Robdebert Please can you retest WITHOUT this PR and confirm that you have the problem you originally described with Danish as no one else has been able to confirm it.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10810.

avatar brianteeman brianteeman - change - 27 Jun 2016
Status Pending Information Required
avatar brianteeman brianteeman - change - 10 Jul 2016
Status Information Required Closed - Unconfirmed Report
Closed_Date 0000-00-00 00:00:00 2016-07-10 09:58:06
Closed_By brianteeman
avatar brianteeman brianteeman - close - 10 Jul 2016
avatar brianteeman brianteeman - close - 10 Jul 2016
avatar brianteeman
brianteeman - comment - 10 Jul 2016

I am closing this at this time as no one else has been able to replicate the reported issue. It can always be reopened if required


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10810.

Add a Comment

Login with GitHub to post a comment