This project is archived and is in readonly mode.
Patch for internationalization (I18n) of label method when binding a form with form_for
-
Antonio Espinosa
- Title changed from Internationalization (I18n) of label method when binding a form with form_for to Patch for internationalization (I18n) of label method when binding a form with form_for
-
José Valim
- State changed from new to duplicate
It's on both Rails 2.3 and Rails 3.0. Please wait for the next release.
-
Sebastian
- Assigned user set to José Valim
José, I'm using actionpack-2.3.5, line 742 in actionpack-2.3.5/lib/action_view/helpers/form_helper.rb still looks like this:
content = (text.blank? ? nil : text.to_s) || method_name.humanizeOr are you talking about 2.3.6?
-
José Valim
About 2.3.6. Check http://github.com/rails/rails.
-
Antonio Espinosa
v 2.3.6
Line 808: I18n.t("helpers.label.#{object_name}.#{method_name}", :default => "").presenceThis version use the scope "helpers.label" in the locale file. Why not use the already existing scope "activerecord.attributes" used by Model#human_attribute_name ?
-
José Valim
Because it should be ORM agnostic. What if you are using Datamapper? Your own form object?
-
Antonio Espinosa
So what's your recommandation for not have redundant text in activerecords.attributes and helpers.label scope ? Overload Model#human_attribute_name to use label.section instead of activerecords.attributes ?
Thanks. -
José Valim
The code on 2.3.6 and 3.0.0 searches first in helpers.label and then in activerecord.attribute. Please take a look at the code that you will see it.
-
Antonio Espinosa
This is right.
Thank you José.