Rails 4 - change pluralize rules

85 views Asked by At

How can we change the pluralize rules for translations in Rails 4? I tried to modify the initialisers/inflections.rb as follows:

ActiveSupport::Inflector.inflections(:fr) do |inflect|
   inflect.irregular 'Niveau', 'Niveaux'
end

ActiveSupport::Inflector.inflections(:fr) do |inflect|
  inflect.acronym 'RESTful'
end

and pass the translation in the page like that:

= link_to t('links.back_to', model: Level.model_name.human.pluralize), levels_path

but it is still translated by applying the default patterns. Any idea on how to fix that ? Thank you

0

There are 0 answers