Module: RailsLocaleDetection::LocaleAccessors

Included in:
ControllerMethods, LocaleDetector
Defined in:
lib/rails_locale_detection/locale_accessors.rb

Instance Method Summary collapse

Instance Method Details

#alternate_localesObject



3
4
5
# File 'lib/rails_locale_detection/locale_accessors.rb', line 3

def alternate_locales
  available_locales - [current_locale]
end

#available_localesObject



7
8
9
# File 'lib/rails_locale_detection/locale_accessors.rb', line 7

def available_locales
  I18n.available_locales
end

#current_localeObject



11
12
13
# File 'lib/rails_locale_detection/locale_accessors.rb', line 11

def current_locale
  I18n.locale
end

#current_locale=(locale) ⇒ Object



15
16
17
# File 'lib/rails_locale_detection/locale_accessors.rb', line 15

def current_locale=(locale)
  I18n.locale = locale
end

#default_localeObject



19
20
21
# File 'lib/rails_locale_detection/locale_accessors.rb', line 19

def default_locale
  I18n.default_locale
end