diff --git a/lib/i18n/backend/base.rb b/lib/i18n/backend/base.rb index f780371d..628dac19 100644 --- a/lib/i18n/backend/base.rb +++ b/lib/i18n/backend/base.rb @@ -10,7 +10,6 @@ module Base RESERVED_KEYS = [:scope, :default, :separator, :resolve, :object, :fallback] RESERVED_KEYS_PATTERN = /%\{(#{RESERVED_KEYS.join("|")})\}/ - DEPRECATED_INTERPOLATION_SYNTAX_PATTERN = /(\\)?\{\{([^\}]+)\}\}/ # Accepts a list of paths to translation files. Loads translations from # plain Ruby (*.rb) or YAML files (*.yml). See #load_rb and #load_yml @@ -150,16 +149,6 @@ def pluralize(locale, entry, count) def interpolate(locale, string, values = {}) return string unless string.is_a?(::String) && !values.empty? - string = string.gsub(DEPRECATED_INTERPOLATION_SYNTAX_PATTERN) do - escaped, key = $1, $2.to_sym - if escaped - "{{#{key}}}" - else - warn_syntax_deprecation!(locale, string) - "%{#{key}}" - end - end - values.each do |key, value| value = value.call(values) if interpolate_lambda?(value, string, key) value = value.to_s unless value.is_a?(::String) diff --git a/lib/i18n/tests/interpolation.rb b/lib/i18n/tests/interpolation.rb index 64e04c89..06613f27 100644 --- a/lib/i18n/tests/interpolation.rb +++ b/lib/i18n/tests/interpolation.rb @@ -54,13 +54,6 @@ module Interpolation assert_equal 'Hi Yehuda!', interpolate(:interpolate, :name => 'Yehuda') end - test "interpolation: works with the deprecated syntax" do - deprecation = capture(:stderr) do - assert_equal 'Hi David!', interpolate(:default => 'Hi {{name}}!', :name => 'David') - end - assert_match "The {{key}} interpolation syntax in I18n messages is deprecated", deprecation - end - test "interpolation: given the translation is in utf-8 it still works" do assert_equal 'Häi David!', interpolate(:default => 'Häi %{name}!', :name => 'David') end