class method self.with_locale

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

self.with_locale(tmp_locale = nil)

Executes block with given I18n.locale set.

Parameters

tmp_locale opt = nil
Source
# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n.rb, line 236
    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

Defined in activesupport/lib/active_support/vendor/i18n-0.4.1/i18n.rb line 236 · View on GitHub · Improve this page · Find usages on GitHub

Defined in I18n

Type at least 2 characters to search.

↑↓ navigate · open · esc close