This project is archived and is in readonly mode.
labels don't treat I18n name_html as html_safe
-
Sam Ruby
Found a second problem. Rails provides the ability to substitute model names (e.g.,
es.activcerecord.models.order) and attribute names (e.g.,es.activerecord.attributes.order.address). Previously, if these values were not present, the actual model and attribute names would be used.This still works for attribute names. For model names, a "translation_missing" message is produced. Furthermore, this messages is formatted as HTML, but is not marked as html_safe, so it appears escaped in the output.
Examples of both problems can be seen here: http://intertwingly.net/projects/AWDwR4/checkdepot-30/section-15.3....
Search for
translation_missingandó. -
José Valim
"Apparently f.label :address is smart enough to pick up the translation for address_html, but not smart enough to treat that text as HTML safe."
This is weird, f.label should not be picking up "address_html" and I don't expect it to. I will take a look at this later and at the other bugs reported here.
-
Aditya Sanghi
I was unable to reproduce both problems on Rails 3.0.3 / 1.8.7 / OSX
-
Josh Kalderimis
Regarding your model names issue in your first comment, I tried to reproduce this error but could not get the "translation_missing" message to appear.
Are you able to create a barbones rails app reproducing this issue, pop it on GitHub, then add a link to the repo in the comments here. That way we can have a look at the code and gems and see what is causing the issue.
Thanks.
-
Sam Ruby
- State changed from new to wontfix
The "translation_missing" was an error on my part: my test make changes in the wrong order, so calls to I18n.t were introduced before the associated translations were added to the appropriate locales file. My bad.
If f.label is not expected to pick up the _html name, then I will simply add
, t('name_html')to the f.label call.