Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Antoine Bergeron 13 posts 33 karma points
    Apr 23, 2014 @ 20:09
    Antoine Bergeron
    0

    Recaptcha - How to translate ?

    Hi,

    I'm using reCaptcha in a form, and it's working great. I'm using the basic version of it, and can set the look normally witht thwe Theme picker in the additional settings.

    However, I can't seem to translate it (I need it in French, or with customized labels). I've looked at the google doc, and tried adding a lang variable like suggested, or specific words, but it looks like it's always ignored. Any tips on where I need to add said variable, or some other way to make it work? 

    I'm using Umbraco 6.1.6, with Contour 3.0.19

    Thanks,

    Antoine

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 23, 2014 @ 21:59
    Dennis Aaen
    0

    Hi Antoine,

    The way that you can make things translatable in Umbraco is by creating dictionary items. And these dictionary items can also be used in Contour. The way that you get Contour to use dictionary items is by adding a # in the front of the label name. And after that just create the dictionary item in the settings section in the dictionary forlder.

    So e.g the label for the email would look like #email, and then you need to create a dictionary with the name email (without the #)

    Here are some documentation about how to create dictionary items in Umbraco and work with them in Umbraco and with Contour.

    Dictionary in Umbraco: http://24days.in/umbraco/2013/the-dictionary-secrets/ and http://our.umbraco.org/wiki/how-tos/how-to-localize-umbraco-backend-document-types and

    Dictionary with Contour: http://umbraco.com/help-and-support/video-tutorials/umbraco-pro/contour/manage-multi-language-forms.aspx

    Hope this helps,

    /Dennis

  • Antoine Bergeron 13 posts 33 karma points
    Apr 23, 2014 @ 23:08
    Antoine Bergeron
    0

    Hi Dennis,

    I already knew about that function, but thanks anyway. A reminder is always welcome. :)

    However, my problem comes with the reCaptcha field specifically. I can, and already did, translate the label with the Dictionary. But what I'm not able to change are the intern parts of the captcha box, like the "Type the text" default textbox, or the "Privacy and Term" link. Google does provide translation for those, but to do that, I need to pass the "lang: 'fr'" javascript variable to the constructor.  At least, that's the "easy way, with quotes as I can't seem to find the place to add that call.

    If Umbraco Contour already check the Dictionary for specific terms (like the Submit button does per example), do you know where those would be listed?

    Antoine

  • Antoine Bergeron 13 posts 33 karma points
    Apr 24, 2014 @ 18:25
    Antoine Bergeron
    0

    I have been looking some more into my problem, and it seems that the " lang='fr' " option is no longer working, even if Google documentation still says so. (grumble grumble)   Now, the language parameter need to be passed in the recaptcha challenge call, as a querystring.  To do that, I would need to modify the following line outputed by Contour:

    < script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6LeqoNsSAAAAAOQrdqDFE5KAzDESxxxODLpOeJjh&hl=&">

    Any idea if this can be done, and where? Or is that part coming only from the compiled dll code?

    Antoine

  • Darren R 10 posts 73 karma points
    Feb 11, 2015 @ 23:00
    Darren R
    0

    Hello, 

      I am also running into the same problem as above.  Has anyone figure out a way to set the language on reCaptcha?  I have been searching the internet and have found nothing that may help except to create it outside of using the form field.  

     

    Thanks

  • Ajmal 19 posts 51 karma points
    Jul 28, 2015 @ 11:22
    Ajmal
    0

    There is a workaround. You can edit the \umbraco\Plugins\umbracoContour\Views\Fieldtype.Recaptcha.cshtml to add the recaptcha script again in the bottom with specified language.

    For example:

    @using System.Runtime.CompilerServices
    @using Umbraco.Forms.Mvc.Helpers
    @model Umbraco.Forms.Mvc.Models.FieldViewModel
    @{
        var theme = "clean";
        if (Model.AdditionalSettings.Any(x => x.Key == "Theme"))
        {
            theme = Model.AdditionalSettings.FirstOrDefault(x => x.Key == "Theme").Value;
        }
    }
    @ReCaptchaHelper.ReCaptcha(theme)
    
    
    <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6LeqoNsSAAAAAOQrdqDFE5KAzDESxxxODLpOeJjh&hl=&lang=fr"></script>
    
Please Sign in or register to post replies

Write your reply to:

Draft