module I18n::Backend::InterpolationCompiler - i18n-0.6.11 Documentation

# module I18n::Backend::InterpolationCompiler

### Public Instance Methods

interpolate(locale, string, values) click to toggle source
Calls superclass method

    # File lib/i18n/backend/interpolation_compiler.rb, line 97
    def interpolate(locale, string, values)
      if string.respond_to?(:i18n_interpolate)
        string.i18n_interpolate(values)
      elsif values
        super
      else
        string
      end
    end

store_translations(locale, data, options = {}) click to toggle source
Calls superclass method

    # File lib/i18n/backend/interpolation_compiler.rb, line 107
    def store_translations(locale, data, options = {})
      compile_all_strings_in(data)
      super
    end

### Protected Instance Methods

compile_all_strings_in(data) click to toggle source

    # File lib/i18n/backend/interpolation_compiler.rb, line 113
    def compile_all_strings_in(data)
      data.each_value do |value|
        Compiler.compile_if_an_interpolation(value)
        compile_all_strings_in(value) if value.kind_of?(Hash)
      end
    end