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:



335
336
337
338
339
340
341
342
# File 'lib/i18n.rb', line 335

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