Permalink
Browse files

Remove i18n interpolation deprecation. It has been around since 2.2.

  • Loading branch information...
1 parent 3c1bb40 commit 8e679f1854f05c9352b47bd688d8604d981eae06 @josevalim josevalim committed May 11, 2010
Showing with 0 additions and 26 deletions.
  1. +0 −26 activerecord/lib/active_record/i18n_interpolation_deprecation.rb
@@ -1,26 +0,0 @@
-# Deprecates the use of the former message interpolation syntax in activerecord
-# as in "must have %d characters". The new syntax uses explicit variable names
-# as in "{{value}} must have {{count}} characters".
-
-require 'i18n/backend/simple'
-module I18n
- module Backend
- class Simple
- DEPRECATED_INTERPOLATORS = { '%d' => '{{count}}', '%s' => '{{value}}' }
-
- protected
- def interpolate_with_deprecated_syntax(locale, string, values = {})
- return string unless string.is_a?(String) && !values.empty?
-
- string = string.gsub(/%d|%s/) do |s|
- instead = DEPRECATED_INTERPOLATORS[s]
- ActiveSupport::Deprecation.warn "using #{s} in messages is deprecated; use #{instead} instead."
- instead
- end
-
- interpolate_without_deprecated_syntax(locale, string, values)
- end
- alias_method_chain :interpolate, :deprecated_syntax
- end
- end
-end

0 comments on commit 8e679f1

Please sign in to comment.