Skip to content

Commit

Permalink
Output which locale and string exactly use the deprecated interpolati…
Browse files Browse the repository at this point in the history
…on syntax.

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
lawrencepit authored and josevalim committed Jun 8, 2010
1 parent 7603753 commit 2bee924
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/i18n/backend/base.rb
Expand Up @@ -158,7 +158,7 @@ def interpolate(locale, string, values = {})
if escaped
"{{#{key}}}"
else
warn_syntax_deprecation!
warn_syntax_deprecation!(locale, string)
"%{#{key}}"
end
end
Expand Down Expand Up @@ -219,9 +219,9 @@ def load_yml(filename)
YAML::load(IO.read(filename))
end

def warn_syntax_deprecation! #:nodoc:
def warn_syntax_deprecation!(locale, string) #:nodoc:
return if @skip_syntax_deprecation
warn "The {{key}} interpolation syntax in I18n messages is deprecated. Please use %{key} instead.\n#{caller.join("\n")}"
warn "The {{key}} interpolation syntax in I18n messages is deprecated. Please use %{key} instead.\n#{locale} - #{string}\n#{caller.join("\n")}"
@skip_syntax_deprecation = true
end
end
Expand Down

0 comments on commit 2bee924

Please sign in to comment.