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
3 4 5 |
# File 'lib/rails_locale_detection/locale_accessors.rb', line 3 def alternate_locales available_locales - [current_locale] end |
#available_locales ⇒ Object
7 8 9 |
# File 'lib/rails_locale_detection/locale_accessors.rb', line 7 def available_locales I18n.available_locales end |
#current_locale ⇒ Object
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_locale ⇒ Object
19 20 21 |
# File 'lib/rails_locale_detection/locale_accessors.rb', line 19 def default_locale I18n.default_locale end |