instance method store_translations

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

store_translations(locale, data, options = {})

No documentation comment.

Parameters

locale req
data req
options opt = {}
Source
# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/key_value.rb, line 62
        def store_translations(locale, data, options = {})
          escape = options.fetch(:escape, true)
          flatten_translations(locale, data, escape, @subtrees).each do |key, value|
            key = "#{locale}.#{key}"

            case value
            when Hash
              if @subtrees && (old_value = @store[key])
                old_value = ActiveSupport::JSON.decode(old_value)
                value = old_value.deep_symbolize_keys.deep_merge!(value) if old_value.is_a?(Hash)
              end
            when Proc
              raise "Key-value stores cannot handle procs"
            end

            @store[key] = ActiveSupport::JSON.encode(value) unless value.is_a?(Symbol)
          end
        end

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

Defined in I18n::Backend::KeyValue::Implementation

Type at least 2 characters to search.

↑↓ navigate · open · esc close