diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-19 13:19:20 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-19 13:28:07 +0000 |
commit | 603a679e87d0317957eb44ce3928d593a0c50bb5 (patch) | |
tree | 739959ff9cbd0a6f7d8f3d879591d8b393974635 /actionpack/lib | |
parent | 86b5e81e8ac6590995e1e0643959fe8f527b4e49 (diff) | |
download | rails-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')
-rw-r--r-- | actionpack/lib/action_view/helpers/translation_helper.rb | 4 |
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) |