Browse files

Revert "warn the user values are directly interpolated into _html tra…

…nslation strings"

Reason: After another round of discussion, it has been
decided to let interpolation deal with unsafe strings
as it should do.

This reverts commit d57d809.
  • Loading branch information...
fxn committed Nov 17, 2011
1 parent eb46afa commit 3bcb2472e42477fcd13c9dc2071b6b7a7cf84d20
Showing with 0 additions and 14 deletions.
  1. +0 −2 actionpack/lib/action_view/helpers/translation_helper.rb
  2. +0 −12 railties/guides/source/i18n.textile
@@ -43,8 +43,6 @@ module TranslationHelper
# 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)
@@ -634,18 +634,6 @@ en:
!images/i18n/demo_html_safe.png(i18n demo html safe)!
-Please note that values are interpolated directly into the translation.
-If they need to be escaped you need to pass them already escaped in the +t+ call.
-# config/locales/en.yml
- welcome_html: <b>Welcome %{name}!</b>
-<%# Note the call to h() to avoid injection %>
-<%= t('welcome_html', :name => h( %>
h3. How to Store your Custom Translations
The Simple backend shipped with Active Support allows you to store translations in both plain Ruby and YAML format. [2]

0 comments on commit 3bcb247

Please sign in to comment.