Module: RailsLocaleDetection::LocaleAccessors
- Included in:
- ControllerMethods, LocaleDetector
- Defined in:
- lib/rails_locale_detection/locale_accessors.rb
Instance Method Summary collapse
- #alternate_locales ⇒ Object
- #available_locales ⇒ Object
- #current_locale ⇒ Object
- #current_locale=(locale) ⇒ Object
- #default_locale ⇒ Object
Instance Method Details
#alternate_locales ⇒ Object
5 6 7 |
# File 'lib/rails_locale_detection/locale_accessors.rb', line 5 def alternate_locales available_locales - [current_locale] end |
#available_locales ⇒ Object
9 10 11 |
# File 'lib/rails_locale_detection/locale_accessors.rb', line 9 def available_locales I18n.available_locales end |
#current_locale ⇒ Object
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_locale ⇒ Object
21 22 23 |
# File 'lib/rails_locale_detection/locale_accessors.rb', line 21 def default_locale I18n.default_locale end |