aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-11-17 23:07:06 +0100
committerXavier Noria <fxn@hashref.com>2011-11-17 23:07:06 +0100
commitd57d8098fc269a26ea0051a9027a33af1a9a4b2b (patch)
tree1e46a9fc570603e5f737940dabb3a88ff94b9555 /actionpack
parent9b534060bfafbf1db36e73bb3e538b8c412dcc54 (diff)
downloadrails-d57d8098fc269a26ea0051a9027a33af1a9a4b2b.tar.gz
rails-d57d8098fc269a26ea0051a9027a33af1a9a4b2b.tar.bz2
rails-d57d8098fc269a26ea0051a9027a33af1a9a4b2b.zip
warn the user values are directly interpolated into _html translation strings
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/translation_helper.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionpack/lib/action_view/helpers/translation_helper.rb
index be64dc823e..0e6c3c5724 100644
--- a/actionpack/lib/action_view/helpers/translation_helper.rb
+++ b/actionpack/lib/action_view/helpers/translation_helper.rb
@@ -43,6 +43,8 @@ module ActionView
# a safe HTML string that won't be escaped by other HTML helper methods. This
# naming convention helps to identify translations that include HTML tags so that
# you know what kind of output to expect when you call translate in a template.
+ # Note however that rule extends to interpolated values, so you are responsible
+ # for passing them already escaped in the call, if they need to be.
def translate(key, options = {})
options.merge!(:rescue_format => :html) unless options.key?(:rescue_format)
translation = I18n.translate(scope_key_by_partial(key), options)