Module: I18n::Backend::Metadata
- Defined in:
- lib/i18n/backend/metadata.rb
Class Method Summary collapse
Instance Method Summary collapse
- #interpolate(locale, entry, values = {}) ⇒ Object
- #pluralize(locale, entry, count) ⇒ Object
- #translate(locale, key, options = {}) ⇒ Object
Class Method Details
.included(base) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/i18n/backend/metadata.rb', line 21 def included(base) Object.class_eval do def unless self.frozen? @translation_metadata ||= {} else {} end end def () @translation_metadata = unless self.frozen? end end unless Object.method_defined?(:translation_metadata) end |
Instance Method Details
#interpolate(locale, entry, values = {}) ⇒ Object
50 51 52 53 |
# File 'lib/i18n/backend/metadata.rb', line 50 def interpolate(locale, entry, values = {}) = entry..merge(:original => entry) () { super } end |
#pluralize(locale, entry, count) ⇒ Object
55 56 57 |
# File 'lib/i18n/backend/metadata.rb', line 55 def pluralize(locale, entry, count) (:count => count) { super } end |
#translate(locale, key, options = {}) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/i18n/backend/metadata.rb', line 38 def translate(locale, key, = {}) = { :locale => locale, :key => key, :scope => [:scope], :default => [:default], :separator => [:separator], :values => .reject { |name, value| RESERVED_KEYS.include?(name) } } () { super } end |