aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/translation_helper.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-11-19 13:19:20 +0000
committerJon Leighton <j@jonathanleighton.com>2011-11-19 13:28:07 +0000
commit603a679e87d0317957eb44ce3928d593a0c50bb5 (patch)
tree739959ff9cbd0a6f7d8f3d879591d8b393974635 /actionpack/lib/action_view/helpers/translation_helper.rb
parent86b5e81e8ac6590995e1e0643959fe8f527b4e49 (diff)
downloadrails-603a679e87d0317957eb44ce3928d593a0c50bb5.tar.gz
rails-603a679e87d0317957eb44ce3928d593a0c50bb5.tar.bz2
rails-603a679e87d0317957eb44ce3928d593a0c50bb5.zip
Don't html-escape the :count option to translate if it's a Numeric. Fixes #3685.
Diffstat (limited to 'actionpack/lib/action_view/helpers/translation_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/translation_helper.rb4
1 files changed, 3 insertions, 1 deletions
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)