提交 1b0afb31 编写于 作者: D David Heinemeier Hansson

A few more style changes

上级 d5b0ba66
......@@ -150,10 +150,10 @@ def load_path=(load_path)
# I18n.t [:foo, :bar], :scope => :baz
def translate(key, options = {})
locale = options.delete(:locale) || I18n.locale
backend.translate locale, key, options
backend.translate(locale, key, options)
rescue I18n::ArgumentError => e
raise e if options[:raise]
send @@exception_handler, e, locale, key, options
send(@@exception_handler, e, locale, key, options)
end
alias :t :translate
......@@ -180,8 +180,8 @@ def default_exception_handler(exception, locale, key, options)
# keys are Symbols.
def normalize_translation_keys(locale, key, scope)
keys = [locale] + Array(scope) + [key]
keys = keys.map{|k| k.to_s.split(/\./) }
keys.flatten.map{|k| k.to_sym}
keys = keys.map { |k| k.to_s.split(/\./) }
keys.flatten.map { |k| k.to_sym }
end
end
end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册