mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Added localize helper method
This commit is contained in:
@@ -11,6 +11,10 @@ module ActionView
|
||||
keys = I18n.send :normalize_translation_keys, e.locale, e.key, e.options[:scope]
|
||||
content_tag('span', keys.join(', '), :class => 'translation_missing')
|
||||
end
|
||||
|
||||
def localize(*args)
|
||||
I18n.l *args
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -39,4 +39,10 @@ class TranslationHelperTest < Test::Unit::TestCase
|
||||
# error_messages_for(:object => @object, :locale => 'en-US')
|
||||
# end
|
||||
end
|
||||
|
||||
def test_delegates_localize_to_i18n
|
||||
@time = Time.utc(2008, 7, 8, 12, 18, 38)
|
||||
assert_equal "Tue, 08 Jul 2008 12:18:38 +0100", localize(@time)
|
||||
assert_equal "08 Jul 12:18", localize(@time, :format => :short)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user