Created
February 17, 2010 20:37
-
-
Save logandk/306991 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/authlogic.rb | |
Authlogic::I18n.translator = FixedAuthlogicI18n::Translator.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing! Wasted over an hour on this...