Module: Maglev::Site::LocalesConcern
- Extended by:
- ActiveSupport::Concern
- Included in:
- Maglev::Site
- Defined in:
- app/models/maglev/site/locales_concern.rb
Overview
rubocop:disable Style/ClassAndModuleChildren
Defined Under Namespace
Classes: LocalesSerializer
Instance Method Summary
collapse
Instance Method Details
#default_locale ⇒ Object
15
16
17
|
# File 'app/models/maglev/site/locales_concern.rb', line 15
def default_locale
locales.first
end
|
#default_locale_prefix ⇒ Object
19
20
21
|
# File 'app/models/maglev/site/locales_concern.rb', line 19
def default_locale_prefix
default_locale.prefix.to_sym
end
|
#each_locale ⇒ Object
27
28
29
30
31
32
33
|
# File 'app/models/maglev/site/locales_concern.rb', line 27
def each_locale
locale_prefixes.each do |locale|
Maglev::I18n.with_locale(locale) do
yield(locale)
end
end
end
|
#locale_prefixes ⇒ Object
23
24
25
|
# File 'app/models/maglev/site/locales_concern.rb', line 23
def locale_prefixes
locales.map { |locale| locale.prefix.to_sym }
end
|