10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/mini_i18n/localization.rb', line 10
def localize(object, options = {})
return multiple_localize(object, options) if object.is_a?(Array)
options = expand_all_locales(options)
return multiple_locales_localize(object, options) if options[:locale].is_a?(Array)
case object
when Numeric
localize_number(object, options)
when Date
localize_datetime(object, options.merge(type: :date))
when Time, DateTime
localize_datetime(object, options.merge(type: :time))
when String
localize_string(object, options)
end
end
|