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



5
6
7
# File 'lib/rails_locale_detection/locale_accessors.rb', line 5

def alternate_locales
  available_locales - [current_locale]
end

#available_localesObject



9
10
11
# File 'lib/rails_locale_detection/locale_accessors.rb', line 9

def available_locales
  I18n.available_locales
end

#current_localeObject



13
14
15
# File 'lib/rails_locale_detection/locale_accessors.rb', line 13

def current_locale
  I18n.locale
end

#current_locale=(locale) ⇒ Object



17
18
19
# File 'lib/rails_locale_detection/locale_accessors.rb', line 17

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

#default_localeObject



21
22
23
# File 'lib/rails_locale_detection/locale_accessors.rb', line 21

def default_locale
  I18n.default_locale
end