Module: RailsAdmin::I18nSupport
- Included in:
- ApplicationHelper, Config::Fields::Types::Datetime
- Defined in:
- lib/rails_admin/i18n_support.rb
Instance Method Summary collapse
- #abbr_day_names ⇒ Object
- #abbr_month_names ⇒ Object
- #date_format ⇒ Object
- #day_names ⇒ Object
- #month_names ⇒ Object
Instance Method Details
#abbr_day_names ⇒ Object
5 6 7 8 9 |
# File 'lib/rails_admin/i18n_support.rb', line 5 def abbr_day_names I18n.t('date.abbr_day_names', raise: true) rescue I18n::ArgumentError I18n.t('date.abbr_day_names', locale: :en) end |
#abbr_month_names ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/rails_admin/i18n_support.rb', line 11 def abbr_month_names begin names = I18n.t('date.abbr_month_names', raise: true) rescue I18n::ArgumentError names = I18n.t('date.abbr_month_names', locale: :en) end names[1..-1] end |
#date_format ⇒ Object
20 21 22 |
# File 'lib/rails_admin/i18n_support.rb', line 20 def date_format I18n.t('date.formats.default', default: I18n.t('date.formats.default', locale: :en)) end |
#day_names ⇒ Object
24 25 26 27 28 |
# File 'lib/rails_admin/i18n_support.rb', line 24 def day_names I18n.t('date.day_names', raise: true) rescue I18n::ArgumentError I18n.t('date.day_names', locale: :en) end |
#month_names ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/rails_admin/i18n_support.rb', line 30 def month_names begin names = I18n.t('date.month_names', raise: true) rescue I18n::ArgumentError names = I18n.t('date.month_names', locale: :en) end names[1..-1] end |