Method: I18n::Base#localize

Defined in:
lib/i18n.rb

#localize(object, locale: nil, format: nil, **options) ⇒ Object Also known as: l

Localizes certain objects, such as dates and numbers to local formatting.

Raises:


295
296
297
298
299
300
301
302
# File 'lib/i18n.rb', line 295

def localize(object, locale: nil, format: nil, **options)
  locale ||= config.locale
  raise Disabled.new('l') if locale == false
  enforce_available_locales!(locale)

  format ||= :default
  config.backend.localize(locale, object, format, options)
end