User tests: Successful: Unsuccessful:
Pull Request for Issue #10809
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';
See the Issue for testing / reproducing instructions: #10809
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Title |
|
Title |
|
Title |
|
Title |
|
Title |
|
Category | ⇒ | Plugins |
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.
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
@brianteeman Fixed your messages: fd6a1d4
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
@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.
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.
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.
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/
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?
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
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
What may happen for the languages with 3 letters code? We have a few for Joomla
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';
}
My test above shows that this code is not needed. It works fine as it is
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.
There is no problem with polish language, tested on v3.5.1
@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.
Status | Pending | ⇒ | Information Required |
Status | Information Required | ⇒ | Closed - Unconfirmed Report |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-07-10 09:58:06 |
Closed_By | ⇒ | brianteeman |
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
Btw: the PHP 5.6 Travis-CI Build always fails, because it still uses "mysql" instead of "mysqli" - can someone please fix this?