I18n

From reCAPTCHA Wiki

Jump to: navigation, search

There are three ways to internationalize reCAPTCHA:

Built in translations

reCAPTCHA has a number of built in translations. You can use these by setting the lang parameter using the API.

var RecaptchaOptions = {
   lang : 'fr',
};

Custom Translations

If there isn't a translation for your language, you can build your own. You need to translate all of the strings in [1] and set the "custom_translations" variable of RecaptchaOptions. Any strings that you don't set will be taken from the default translation for your language. You can use this to override only part of a default translation (eg, if the translation we chose doesn't fit your region).

Example:

var RecaptchaOptions = {
   custom_translations : { instructions_visual : "This is my text:" }
};


For reCaptcha integrated into a PHP page, pack the line into a script tag and place it before the reCaptha is called.

<script type= "text/javascript">
var RecaptchaOptions = {
custom_translations : { instructions_visual : "This is my text:"}
};
</script>


Here a working example of a custom italian translation (place this code before you call the reCaptcha):

	<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 this code (just for audio challenge)
			theme : 'red',
			};
	</script>

In the above example, we added the option lang : 'it' because the audio challenge for italian people is difficult if in English: so setting the language it, although reCaptcha doesn't have italian speech, at least a list of English numbers is needed to recognize from partially sighted people.

Personal tools