public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
I18n: move old-style interpolation syntax deprecation to Active Record. [#1044 
state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
svenfuchs (author)
Sun Sep 14 04:36:06 -0700 2008
lifo (committer)
Sat Sep 20 11:13:50 -0700 2008
commit  8cb7d460439a9b20a80a77b6370c1107233d1cbd
tree    ddd5d29a0ab3f39e685ed35dc681a58114acf309
parent  9d7f186f746f38367851355fcd301ac24d6f6a51
...
77
78
79
 
80
81
...
77
78
79
80
81
 
0
@@ -77,5 +77,5 @@ require 'active_record/connection_adapters/abstract_adapter'
0
 
0
 require 'active_record/schema_dumper'
0
 
0
+require 'active_record/i18n_interpolation_deprecation'
0
 I18n.load_translations File.dirname(__FILE__) + '/active_record/locale/en-US.yml'
0
-
...
4
5
6
7
8
9
10
...
120
121
122
123
124
125
126
127
128
129
130
131
...
4
5
6
 
7
8
9
...
119
120
121
 
 
 
 
 
 
122
123
124
0
@@ -4,7 +4,6 @@ module I18n
0
   module Backend
0
     class Simple
0
       INTERPOLATION_RESERVED_KEYS = %w(scope default)
0
-      DEPRECATED_INTERPOLATORS = { '%d' => '{{count}}', '%s' => '{{value}}' }
0
       MATCH = /(\\\\)?\{\{([^\}]+)\}\}/
0
 
0
       # Accepts a list of paths to translation files. Loads translations from 
0
@@ -120,12 +119,6 @@ module I18n
0
         def interpolate(locale, string, values = {})
0
           return string unless string.is_a?(String)
0
 
0
-          string = string.gsub(/%d|%s/) do |s|
0
-            instead = DEPRECATED_INTERPOLATORS[s]
0
-            ActiveSupport::Deprecation.warn "using #{s} in messages is deprecated; use #{instead} instead."
0
-            instead
0
-          end
0
-
0
           if string.respond_to?(:force_encoding)
0
             original_encoding = string.encoding
0
             string.force_encoding(Encoding::BINARY)

Comments