Skip to content
This repository
Browse code

Change array entries to safe doesn't worth then the array is joined a…

…s a string losing the safe property of his entries

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 374e49b467ec480ebeeae4280d412f44094a9870 1 parent ebf300f
Santiago Pastorino spastorino authored josevalim committed
2  actionpack/lib/action_view/helpers/translation_helper.rb
@@ -13,7 +13,7 @@ module TranslationHelper
13 13 def translate(key, options = {})
14 14 options[:raise] = true
15 15 translation = I18n.translate(scope_key_by_partial(key), options)
16   - translation.is_a?(Array) ? translation.map { |entry| entry.html_safe } : translation.html_safe
  16 + translation.respond_to?(:html_safe) ? translation.html_safe : translation
17 17 rescue I18n::MissingTranslationData => e
18 18 keys = I18n.send(:normalize_translation_keys, e.locale, e.key, e.options[:scope])
19 19 content_tag('span', keys.join(', '), :class => 'translation_missing')

0 comments on commit 374e49b

Please sign in to comment.
Something went wrong with that request. Please try again.