Since Rails 4 it’
possible to use locale-specific pluralization rules by doing
something like "Produkt".pluralize(:de).
Is there any reason
why ActionView::Helpers::TextHelper#pluralize doesn’t accept an (optional) locale argument, too?
Sample usage (in a
view or helper):
pluralize(Product.count, "Produkt", locale: :de)
As far as I can see,
adding an optional keyword argument to https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/text_helper.rb#L220 shouldn’t be a problem regarding backwards compatibility.
Should I prepare a
pull request?
Thanks, Stefan