Module: I18n::Backend::Metadata

Defined in:
lib/active_support/vendor/i18n-0.4.1/i18n/backend/metadata.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/backend/metadata.rb', line 21

def included(base)
  Object.class_eval do
    def 
      @translation_metadata ||= {}
    end

    def translation_metadata=()
      @translation_metadata = 
    end
  end unless Object.method_defined?(:translation_metadata)
end

Instance Method Details

#interpolate(locale, entry, values = {}) ⇒ Object



46
47
48
49
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/backend/metadata.rb', line 46

def interpolate(locale, entry, values = {})
   = entry..merge(:original => entry)
  () { super }
end

#pluralize(locale, entry, count) ⇒ Object



51
52
53
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/backend/metadata.rb', line 51

def pluralize(locale, entry, count)
  (:count => count) { super }
end

#translate(locale, key, options = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/backend/metadata.rb', line 34

def translate(locale, key, options = {})
   = {
    :locale    => locale,
    :key       => key,
    :scope     => options[:scope],
    :default   => options[:default],
    :separator => options[:separator],
    :values    => options.reject { |name, value| Base::RESERVED_KEYS.include?(name) }
  }
  () { super }
end