This project is archived and is in readonly mode.

#2233 ✓invalid
vincent

pluzalization for the body section of error_messages_for

Reported by vincent | March 14th, 2009 @ 10:52 AM | in 2.x

Hi

I am French, and using the I18n of Rails, I noticed it wasn't possible to use the singularization/pluralization behavior for the body part of the helper error_messages_for, whereas we can for the the header part. I found strange to have, for a single error, a header in singular, and the body in plural. So I suggest to modify the line 200 in vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb message = options.include?(:message) ? options[:message] : locale.t(:body) by message = options.include?(:message) ? options[:message] : locale.t(:body, :count => count )

and then have the possibility to write :

fr: activerecord:

errors:
  template:
    header:
      one: "Impossible d'enregistrer {{model}}: 1 erreur"
      other: "Impossible d'enregistrer {{model}}: {{count}} erreurs."
    body:
      one : "Veuillez vérifier le champ suivant :"
      other "Veuillez vérifier les champs suivants :"

Thanks

Vincent

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages