Class: R18n::RailsUnpluralizetedTranslation

Inherits:
UnpluralizetedTranslation
  • Object
show all
Defined in:
lib/r18n-rails-api/filters.rb

Overview

Class to mark unpluralized translation and convert Rails plural keys

Instance Method Summary collapse

Instance Method Details

#[](name, *params) ⇒ Object



43
44
45
46
47
48
49
50
# File 'lib/r18n-rails-api/filters.rb', line 43

def [](name, *params)
  result = super
  if result.is_a? Untranslated
    fixed = super(RailsPlural.to_r18n(name), *params)
    result = fixed unless fixed.is_a? Untranslated
  end
  result
end