diff --git a/lib/i18n.rb b/lib/i18n.rb index 429ce46a..be10b101 100644 --- a/lib/i18n.rb +++ b/lib/i18n.rb @@ -377,12 +377,12 @@ def with_locale(tmp_locale = nil) if tmp_locale == nil yield else - current_locale = self.locale + current_locale = config.raw_locale self.locale = tmp_locale begin yield ensure - self.locale = current_locale + writable_config.raw_locale = current_locale end end end diff --git a/lib/i18n/config.rb b/lib/i18n/config.rb index 2424c27b..e7232cfc 100644 --- a/lib/i18n/config.rb +++ b/lib/i18n/config.rb @@ -10,6 +10,14 @@ def locale defined?(@locale) && @locale != nil ? @locale : default_locale end + def raw_locale # :nodoc: + @locale + end + + def raw_locale=(locale) # :nodoc: + @locale = locale + end + def initialize @owner = Fiber.current end