This project is archived and is in readonly mode.

#3799 ✓committed
Marc Schütz

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

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>

Attachments

Pages