Module: I18n::Backend::Metadata

Defined in:
lib/i18n/backend/metadata.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) included(base)



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/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

- (Object) interpolate(locale, entry, values = {})



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

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

- (Object) pluralize(locale, entry, count)



51
52
53
# File 'lib/i18n/backend/metadata.rb', line 51

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

- (Object) translate(locale, key, options = {})



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/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| RESERVED_KEYS.include?(name) }
  }
  () { super }
end