Skip to content
Browse files

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...
1 parent ebf300f commit 374e49b467ec480ebeeae4280d412f44094a9870 @spastorino spastorino committed with josevalim Mar 8, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/helpers/translation_helper.rb
View
2 actionpack/lib/action_view/helpers/translation_helper.rb
@@ -13,7 +13,7 @@ module TranslationHelper
def translate(key, options = {})
options[:raise] = true
translation = I18n.translate(scope_key_by_partial(key), options)
- translation.is_a?(Array) ? translation.map { |entry| entry.html_safe } : translation.html_safe
+ translation.respond_to?(:html_safe) ? translation.html_safe : translation
rescue I18n::MissingTranslationData => e
keys = I18n.send(:normalize_translation_keys, e.locale, e.key, e.options[:scope])
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.