This project is archived and is in readonly mode.
arrays from i18n files and html_safe!
Reported by Marc Schütz | January 27th, 2010 @ 09:51 PM | in 3.0.2
ActionView::Helpers::TranslationHelper.translate in edge calls html_safe! on the return value of I18n.translate regardless of what type it is.
This makes using arrays impossible, because they don't respond to html_safe!. Arrays are used in the "standard" locale files by Sven Fuchs e.a. for day_names, month_names etc.
A simple workaround is this:
class Array
def html_safe!
each {|e| e.html_safe! unless e.nil? }
end
end
Comments and changes to this ticket
-
Marc Schütz February 18th, 2010 @ 02:37 PM
- Tag set to i18n, rails3
-
Santiago Pastorino February 19th, 2010 @ 12:35 AM
- Tag changed from i18n, rails3 to i18n, patch, rails3
Patch with a failing test added
-
Santiago Pastorino February 19th, 2010 @ 12:58 AM
- Milestone cleared.
- State changed from new to committed
-
MikZ May 17th, 2010 @ 01:38 AM
its really commited?
i can't see it in rails 3 beta 3 or master neighter -
Santiago Pastorino May 17th, 2010 @ 04:28 AM
Yes but i've re-implemented different. Take a look at how is now the translate method on actionpack/lib/action_view/helpers/translation_helper.rb
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Medium
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>