javascript - Recaptcha Translations -


i trying use recaptcha.net's captcha service, use custom translations (https://developers.google.com/recaptcha/docs/customization#i18n) built in ones not cover languages. also, rather using 1 of standard themes, go custom match captcha's site.

below snippet of trying, funny reason not working (text remaining in english rather translated). wondering whether text links "get captcha", "get audio captcha", "help", etc translate. if understanding correctly, these should translate, depending on strings set in custom_translations attribute. also, in case replace contents of text links icon instead of text, icons alt tag appropriate content automatically?

so, example, if change this:

<div class="recaptcha_only_if_image"><a href="javascript:recaptcha.switch_type('audio')">get audio captcha</a></div> 

to this, alt tags of image prefilled automatically when hover on icon says "get audio captcha"?

<div class="recaptcha_only_if_image"><a href="javascript:recaptcha.switch_type('audio')"><img height="16" width="16" src="audio.gif" alt="" /></a></div> 

i asking question when tried chose 1 of standard themes, such `theme : 'red', alt tags being translated automatically depending on language.

here snippet of code. have removed public key below.

js:

<script type="text/javascript">     var recaptchaoptions = {             custom_translations : {                     instructions_visual : "scrivi le due parole:",                     instructions_audio : "trascrivi ci\u00f2 che senti:",                     play_again : "riascolta la traccia audio",                     cant_hear_this : "scarica la traccia in formato mp3",                     visual_challenge : "modalit\u00e0 visiva",                     audio_challenge : "modalit\u00e0 auditiva",                     refresh_btn : "chiedi due nuove parole",                     help_btn : "aiuto",                     incorrect_try_again : "scorretto. riprova.",             },             lang : 'it', // unavailable while writing code (just audio challenge)             theme : 'custom', // make sure there no trailing ',' @ end of recaptchaoptions dictionary       custom_theme_widget: 'recaptcha_widget'     }; </script> 

html

<div id="recaptcha_widget" style="display:none">  <div id="recaptcha_image"></div> <div class="recaptcha_only_if_incorrect_sol" style="color:red">incorrect please try again</div>  <span class="recaptcha_only_if_image">enter words above:</span> <span class="recaptcha_only_if_audio">enter numbers hear:</span>  <input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />  <div><a href="javascript:recaptcha.reload()">get captcha</a></div> <div class="recaptcha_only_if_image"><a href="javascript:recaptcha.switch_type('audio')">get audio captcha</a></div> <div class="recaptcha_only_if_audio"><a href="javascript:recaptcha.switch_type('image')">get image captcha</a></div>  <div><a href="javascript:recaptcha.showhelp()">help</a></div>  </div>   <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=my_public_key">  </script>  <noscript>  <iframe src="http://www.google.com/recaptcha/api/noscript?k=my_public_key"     height="300" width="500" frameborder="0"></iframe><br>  <textarea name="recaptcha_challenge_field" rows="3" cols="40">  </textarea>  <input type="hidden" name="recaptcha_response_field"     value="manual_challenge">  </noscript> 

i attaching screenshot of result.
enter image description here

as understand it, custom_translations javascript object not used if use own html template. in case, have manually translate using same localization rest of app uses. custom_translations used if not provide html yourself, , instead use 1 of predefined themes.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -