Skip to content

Commit

Permalink
Change array entries to safe doesn't worth then the array is joined a…
Browse files Browse the repository at this point in the history
…s a string losing the safe property of his entries

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
spastorino authored and josevalim committed Mar 16, 2010
1 parent ebf300f commit 374e49b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/translation_helper.rb
Expand Up @@ -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')
Expand Down

0 comments on commit 374e49b

Please sign in to comment.