diff options
author | Kir Shatrov <shatrov@me.com> | 2015-09-15 11:20:10 +0300 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2015-09-18 20:04:36 +0300 |
commit | 0f138d1a8b2b6b361e1fc1fea2bb927bce66b909 (patch) | |
tree | 395bbbb0cd7fcf19f69b93fb242b6f94b1b45d67 /actionview/lib/action_view | |
parent | a8f4568f5396b68ae81eddc636604bb78bb6632a (diff) | |
download | rails-0f138d1a8b2b6b361e1fc1fea2bb927bce66b909.tar.gz rails-0f138d1a8b2b6b361e1fc1fea2bb927bce66b909.tar.bz2 rails-0f138d1a8b2b6b361e1fc1fea2bb927bce66b909.zip |
Include interpolation values to translation_missing helper
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/translation_helper.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/translation_helper.rb b/actionview/lib/action_view/helpers/translation_helper.rb index 0615bd2e0d..dde1ef22ac 100644 --- a/actionview/lib/action_view/helpers/translation_helper.rb +++ b/actionview/lib/action_view/helpers/translation_helper.rb @@ -88,7 +88,14 @@ module ActionView raise e if raise_error keys = I18n.normalize_keys(e.locale, e.key, e.options[:scope]) - content_tag('span', keys.last.to_s.titleize, :class => 'translation_missing', :title => "translation missing: #{keys.join('.')}") + title = "translation missing: #{keys.join('.')}" + + interpolations = options.except(:default) + if interpolations.any? + title << ", " << interpolations.map { |k, v| "#{k}: #{ERB::Util.html_escape(v)}" }.join(', ') + end + + content_tag('span', keys.last.to_s.titleize, class: 'translation_missing', title: title) end end alias :t :translate |