Lucas89moya / recaptcha

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

Language Support in DOTNET lib doesn't work #87

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add this script to the page: <script type="text/javascript">
            var RecaptchaOptions = {
                theme : 'white',
                lang : 'de',
                tabindex : 0
            }; </script>

What is the expected output? What do you see instead?
Captcha only in english.

What version of the product are you using? On what operating system?
1.0.4.0

Please provide any additional information below.

Two ways to fix the problem!
1. way: Remove the js script generation in the RenderContents.
2. way:

        /// <summary>
        /// Gets or sets the language.
        /// </summary>
        /// <value>The language.</value>
        [Category("Settings")]
        [Description("Set the language for the reCAPTCHA.")]
        public string Language { get; set; }

// <script> setting
            if (!string.IsNullOrEmpty(Theme) || string.IsNullOrEmpty(Language) || !string.IsNullOrEmpty(CustomThemeWidget))
            {
                output.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript");
                output.RenderBeginTag(HtmlTextWriterTag.Script);
                output.Indent++;
                output.WriteLine("var RecaptchaOptions = {");
                output.Indent++;

                if (!string.IsNullOrEmpty(Theme))
                    output.WriteLine("theme : '{0}',", Theme);

                if (!string.IsNullOrEmpty(CustomThemeWidget))
                    output.WriteLine("custom_theme_widget : '{0}',", customThemeWidget);

                if (!string.IsNullOrEmpty(Language))
                    output.WriteLine("lang : '{0}',", Language);

                output.WriteLine("tabindex : {0}", TabIndex);
                output.Indent--;
                output.WriteLine("};");
                output.Indent--;
                output.RenderEndTag();
            }

Update of file RecaptchaControl.cs is attatched.

Regards Toni

Original issue reported on code.google.com by toni.mus...@googlemail.com on 18 Nov 2010 at 9:27

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by adrian.g...@gmail.com on 1 Dec 2010 at 10:40

GoogleCodeExporter commented 8 years ago

Original comment by adrian.g...@gmail.com on 30 Mar 2012 at 6:17