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.5.4 lib/gettext_i18n_rails/i18n_hacks.rb
nulogy-gettext_i18n_rails-0.5.3.2 lib/gettext_i18n_rails/i18n_hacks.rb
nulogy-gettext_i18n_rails-0.5.3.1 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.5.3 lib/gettext_i18n_rails/i18n_hacks.rb
nulogy-gettext_i18n_rails-0.5.0.3 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.5.2 lib/gettext_i18n_rails/i18n_hacks.rb
nulogy-gettext_i18n_rails-0.5.0.2 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.5.1 lib/gettext_i18n_rails/i18n_hacks.rb
nulogy-gettext_i18n_rails-0.5.0.1 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.5.0 lib/gettext_i18n_rails/i18n_hacks.rb
nulogy-gettext_i18n_rails-0.4.6.2 lib/gettext_i18n_rails/i18n_hacks.rb
nulogy-gettext_i18n_rails-0.4.6.1 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.4.6 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.4.5 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.4.4 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.4.3 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.4.2 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.4.1 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.4.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-0.3.6 lib/gettext_i18n_rails/i18n_hacks.rb