Module: I18n
- Defined in:
- lib/gettext_i18n_rails/i18n_hacks.rb
Defined Under Namespace
Classes: Config
Instance Method Summary (collapse)
- - (Object) locale
- - (Object) locale=(new_locale)
-
- (Object) with_locale(tmp_locale = nil)
Executes block with given I18n.locale set.
Instance Method Details
- (Object) locale
8 9 10 |
# File 'lib/gettext_i18n_rails/i18n_hacks.rb', line 8 def locale FastGettext.locale.to_sym end |
- (Object) locale=(new_locale)
4 5 6 |
# File 'lib/gettext_i18n_rails/i18n_hacks.rb', line 4 def locale=(new_locale) FastGettext.locale = new_locale end |
- (Object) with_locale(tmp_locale = nil)
Executes block with given I18n.locale set.
28 29 30 31 32 33 34 35 36 |
# File 'lib/gettext_i18n_rails/i18n_hacks.rb', line 28 def with_locale(tmp_locale = nil) if tmp_locale current_locale = self.locale self.locale = tmp_locale end yield ensure self.locale = current_locale if tmp_locale end |