Localization in EJ 1 ASP.NET MVC Captcha

20 Sep 2017 / 1 minute to read

The Captcha provides option to localize the place holder string to a particular local language. By default, the Captcha place holder text will use the US English (en-US) as its language.

NOTE

The culture name has to be specified in a standard format such as [Language Code]-[County/Region Code].

To localize the Captcha’s strings with your own localization, copy the default language informations and localize the strings in the values column. For example, to localize the Captcha in French language (“fr-FR”).

  • javascript
  • ej.Captcha.Locale["fr-FR"] =  {
                placeHolderText: "Entrer le code indiqué",
              };

    Set the locale property of the Captcha to the new language.

  • html
  • @(Html.EJ().Captcha("captcha").EnableAutoValidation(true).RequestMapper("Refresh").Locale("fr-FR"))

    Locale