method
localize
v2.2.1 -
Show latest stable
- Class:
ActionView::Helpers::TranslationHelper
localize(*args)public
No documentation available.
# File actionpack/lib/action_view/helpers/translation_helper.rb, line 15
def localize(*args)
I18n.localize *args
end 2Notes
nil Argument Raises An I18n::ArgumentError
You might want to do this:
module ActionView module Helpers module TranslationHelper def localize(*args) #Avoid I18n::ArgumentError for nil values I18n.localize(*args) unless args.first.nil? end # l() still points at old definition alias l localize end end end
formating date
I18n.l Time.now, :format => "%e %B"