Sha256: 3f25d0ba612d33117d84bd2a538bb265990257067570d2a1809dccd5fa2d5ebf

Contents?: true

Size: 321 Bytes

Versions: 158

Compression:

Stored size: 321 Bytes

Contents

# frozen_string_literal: true

module TranslationsHelper
  def with_translations(locale, translations)
    original_backend = I18n.backend

    I18n.backend = I18n::Backend::KeyValue.new({}, true)
    I18n.backend.store_translations(locale, translations)

    yield
  ensure
    I18n.backend = original_backend
  end
end

Version data entries

158 entries across 158 versions & 1 rubygems

Version Path
renalware-core-2.1.1 spec/support/translations.rb
renalware-core-2.1.0 spec/support/translations.rb
renalware-core-2.0.167 spec/support/translations.rb
renalware-core-2.0.166 spec/support/translations.rb
renalware-core-2.0.165 spec/support/translations.rb
renalware-core-2.0.164 spec/support/translations.rb
renalware-core-2.0.163 spec/support/translations.rb
renalware-core-2.0.162 spec/support/translations.rb
renalware-core-2.0.161 spec/support/translations.rb
renalware-core-2.0.160 spec/support/translations.rb
renalware-core-2.0.159 spec/support/translations.rb
renalware-core-2.0.158 spec/support/translations.rb
renalware-core-2.0.157 spec/support/translations.rb
renalware-core-2.0.156 spec/support/translations.rb
renalware-core-2.0.155 spec/support/translations.rb
renalware-core-2.0.153 spec/support/translations.rb
renalware-core-2.0.152 spec/support/translations.rb
renalware-core-2.0.151 spec/support/translations.rb
renalware-core-2.0.149 spec/support/translations.rb
renalware-core-2.0.148 spec/support/translations.rb