Skip to content

Instantly share code, notes, and snippets.

@logandk
Created February 17, 2010 20:37
Show Gist options
  • Select an option

  • Save logandk/306991 to your computer and use it in GitHub Desktop.

Select an option

Save logandk/306991 to your computer and use it in GitHub Desktop.
# config/initializers/authlogic.rb
Authlogic::I18n.translator = FixedAuthlogicI18n::Translator.new
# lib/fixed_authlogic_i18n/translator.rb
module FixedAuthlogicI18n
class Translator
def translate(key, options = {})
return Message.new(key, options)
end
end
class Message
def initialize(key, options)
@key = key
@options = options
end
def to_s
I18n.t(@key, @options)
end
def +(other)
self.to_s + other
end
end
end
@mikezter
Copy link
Copy Markdown

Thanks for sharing! Wasted over an hour on this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment