mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Change array entries to safe doesn't worth then the array is joined as a string losing the safe property of his entries [#4134 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
0f504a5646
commit
e13c179499
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ module ActionView
|
|||
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.normalize_keys(e.locale, e.key, e.options[:scope])
|
||||
content_tag('span', keys.join(', '), :class => 'translation_missing')
|
||||
|
|
Loading…
Reference in a new issue