thiagocavaloti / recaptcha

Automatically exported from code.google.com/p/recaptcha
0 stars 0 forks source link

lang option suddenly being ignored because RecaptchaState now has lang='en' #133

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. follow official instructions to place reCaptcha in a page
2. follow official instructions to set the language to anything other English, 
e.g. 'fr'

What is the expected output? What do you see instead?
 - should see instructions and help in the desired language; instead it's still english

What version of the product are you using? On what operating system?
 - I can find no way to determine what version of reCaptch is being published right now.  I have reproduced this on several Windows operating systems, several browsers, several server side platforms (html, asp, asp.net, php)

Please provide any additional information below.
 - see discussion in recaptcha google group: https://groups.google.com/d/topic/recaptcha/o-YdYJlnRVM/discussion
 - see attached html file for a very straightforward demonstration of the problem

Original issue reported on code.google.com by bob.card...@gmail.com on 9 Feb 2012 at 6:24

Attachments:

GoogleCodeExporter commented 9 years ago
Arg, I'm sorry!  I thought I was submitting to the reCaptcha group, not the 
libraries/plugins group!

Original comment by bob.card...@gmail.com on 9 Feb 2012 at 6:48

GoogleCodeExporter commented 9 years ago
Good news everyone!  If anyone has reached this issue (even though I mistakenly 
created it here), I have some more info that will help you.  A clue left by one 
of the posters in 
https://groups.google.com/d/topic/recaptcha/cFvBBhUonOA/discussion led me to 
discover that if you really want to override the language (which it sounds like 
maybe there's no need to do anymore), you can do so by appending a value with 
key "hl" to your challenge script query string.  So where you now have:
   <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=your_public_key" />
if you want to force, say, French, you could do:
   <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=your_public_key&hl=fr" />

(only difference is the "&hl=fr" at the end there)

Original comment by bob.card...@gmail.com on 9 Feb 2012 at 7:08

GoogleCodeExporter commented 9 years ago
I think this problem is caused by the recaptcha.js.

If you look at this file, you will find this:
getLang_:function(){return "undefined" != typeof RecaptchaState && 
RecaptchaState.lang?RecaptchaState.lang:RecaptchaOptions.lang?RecaptchaOptions.l
ang:null}

As you see, the order of RecaptchaState and RecaptchaOptions is inversed, 
because the js need to look first to options, if is null, then to state.

Original comment by jeison.s...@gmail.com on 29 Feb 2012 at 4:15

GoogleCodeExporter commented 9 years ago
.NET library has been updated to add the workaround query string parameter if 
language parameter is set. Thanks!

Original comment by adrian.g...@gmail.com on 30 Mar 2012 at 5:44

GoogleCodeExporter commented 9 years ago
Can you please update the nuget package as well?

Original comment by denis.vu...@gmail.com on 23 Nov 2012 at 7:20