Sha256: 04ed7277f6023f78a0fd47c0ffbfd7f3e336b19a509f72c8fb66f7d71bb6d29c

Contents?: true

Size: 530 Bytes

Versions: 26

Compression:

Stored size: 530 Bytes

Contents

I18n::Config # autoload

module I18n
  class Config
    def locale
      FastGettext.locale.to_sym
    end

     def locale=(new_locale)
      FastGettext.locale=(new_locale)
    end
  end

  # backport I18n.with_locale if it does not exist
  # Executes block with given I18n.locale set.
  def self.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 unless defined? I18n.with_locale
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
gettext_i18n_rails-0.3.5 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.3.4 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.3.3 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.3.2 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.3.1 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.3.0 lib/gettext_i18n_rails/i18n_hacks.rb