Reputation: 12399
I looked around and it seems that to set pluralization rules for model names you put the following in your locale file
# es.yml
es:
activerecord:
models:
business:
one: Lugar
other: Lugares
However, when the model name is translated in plural, I still get Lugars
instead of Lugares
Not sure what's wrong
Upvotes: 0
Views: 551
Reputation: 27374
Your problem is that you are mixing up two forms of pluralization of strings in Rails. The first is meant for internal purposes: for naming classes, variables, methods, table names, etc. This is pluralize
, and to make it properly handle exceptions etc. you can define inflections in config/initializers/inflections.rb.
But this type of pluralization is not appropriate for translations. For that, you should use Business.model_name.human(:count => 2)
(as @doesterr suggested), which will reference the locale file for the locale you are in, which is what you want.
For details see this answer.
Upvotes: 0