Sha256: 690d40318c324e4fb15130c37eb469d30a42ff57010d560baeaa221a5a08af02

Contents?: true

Size: 544 Bytes

Versions: 45

Compression:

Stored size: 544 Bytes

Contents

I18n::Config # autoload

module I18n
  class Config
    def locale
      FastGettext.locale.gsub("_","-").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

45 entries across 45 versions & 1 rubygems

Version Path
gettext_i18n_rails-1.13.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.12.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.11.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.10.1 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.10.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.9.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.8.1 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.8.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.7.2 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.7.1 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.7.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.6.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.5.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.4.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.3.2 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.3.1 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.3.0 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.2.3 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.2.2 lib/gettext_i18n_rails/i18n_hacks.rb
gettext_i18n_rails-1.2.1 lib/gettext_i18n_rails/i18n_hacks.rb