Language in the reCAPTCHA ASP.NET plugin

I am using the ASP.NET plugin for reCAPTCHA in my ASP.NET MVC application. Recaptcha build version 1.0.4.0. Is there a way to set the language for RecaptchaControl?

    var captchaControl = new Recaptcha.RecaptchaControl
            {
                ID = "recaptcha",
                Theme = "blackglass",
                PublicKey = "public_key",
                PrivateKey = "private_key"
            };
0
source share
2 answers

This feature was not supported in version 1.0.4.0. Download the latest version and try again.

http://code.google.com/p/recaptcha/downloads/detail?name=recaptcha-dotnet-1.0.5.0-binary.zip

+1
source

using this article , here's how I did it. the key edits the generated html at the end; replacing "RecaptchaOptions = {" with "RecaptchaOptions = {lang:" supported_language_code ","

public static string GenerateCaptcha(this HtmlHelper helper)
{
    var captchaControl = new Recaptcha.RecaptchaControl
            {
                ID = "recaptcha",
                Theme = "clean",
                PublicKey = "public_key_here",
                PrivateKey = "private_key_here"
            };
    var htmlWriter = new HtmlTextWriter(new StringWriter());
    captchaControl.RenderControl(htmlWriter);
    var html = htmlWriter.InnerWriter.ToString();
    html = html.Replace("RecaptchaOptions = {", "RecaptchaOptions = { lang : 'tr', ");
    return html;
} 

EDIT: . (System.Web.Helpers)

0

Source: https://habr.com/ru/post/1794358/