From 603a679e87d0317957eb44ce3928d593a0c50bb5 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Sat, 19 Nov 2011 13:19:20 +0000 Subject: Don't html-escape the :count option to translate if it's a Numeric. Fixes #3685. --- actionpack/lib/action_view/helpers/translation_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionpack/lib/action_view/helpers/translation_helper.rb index 42726f888c..cc74eff53a 100644 --- a/actionpack/lib/action_view/helpers/translation_helper.rb +++ b/actionpack/lib/action_view/helpers/translation_helper.rb @@ -48,7 +48,9 @@ module ActionView if html_safe_translation_key?(key) html_safe_options = options.dup options.except(*I18n::RESERVED_KEYS).each do |name, value| - html_safe_options[name] = ERB::Util.html_escape(value.to_s) + unless name == :count && value.is_a?(Numeric) + html_safe_options[name] = ERB::Util.html_escape(value.to_s) + end end translation = I18n.translate(scope_key_by_partial(key), html_safe_options) -- cgit v1.2.3