Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

pluzalization for the body section of error_messages_for

#2233

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

Reported by vincent · March 14th, 2009 @ 10:52 AM

State: invalid
Milestone: 2.x
Assigned to: José Valim José Valim
Importance: none

Activity

  1. José Valim
    José Valim
    • State changed from new to invalid

    error_messages_for was removed from Rails.

    April 10th, 2010 @ 01:03 PM

  2. José Valim
    José Valim
    • Assigned user set to José Valim

    April 10th, 2010 @ 01:11 PM