Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Support for I18n

#7

The error "Captcha response is incorrect, please try again." is hardcoded in English. It would be great is the plugin looked for a translation using the internationalization system in Rails 2.2+.

Martin

Reported by martoche · November 19th, 2008 @ 01:52 PM

State: new
Milestone: none
Assigned to: Jason L Perry Jason L Perry

Activity

  1. Jason L Perry
    Jason L Perry

    Hmm, yes, great idea. I've got a ton of patches to sift through, I'm gonna try to set aside some time this week to take care of them. I'll definitely work on this one too.

    November 20th, 2008 @ 03:24 AM

  2. Roman Shterenzon
    Roman Shterenzon
    • Tag set to i18n, patch

    Please find attached a patch which adds I18n support.

    By the way, the latest changes introduced to the recaptcha rendered the rdoc incorrect. It's impossible to use verify_recaptcha(@model) now, you have rather use verify_recaptcha(:model => @model). I wasted some time in order to understand, why I'm not getting any errors in my model. The simple fix can be adding

    
    @@ -51,6 +51,7 @@ module Ambethia
           # variable +RECAPTCHA_PUBLIC_KEY+.
           def verify_recaptcha(options = {})
             return true if SKIP_VERIFY_ENV.include? ENV['RAILS_ENV']
    +        model = options if options.is_a? ActiveRecord::Base
             private_key = options[:private_key] ||= ENV['RECAPTCHA_PRIVATE_KEY']
             raise ReCaptchaError, "No private key specified." unless private_key
             begin
    

    January 18th, 2009 @ 01:27 PM

  3. Roman Shterenzon
    Roman Shterenzon

    Hmm.. no, sorry, the line "if model = options[:model]" should be changed as well.

    January 18th, 2009 @ 01:29 PM

  4. Roman Shterenzon
    Roman Shterenzon

    I came up with the following, seems to work for both the old and the new way of specifying the model.

    January 18th, 2009 @ 01:37 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.