diff --git a/lib/i18n_interpolation_fallbacks.rb b/lib/i18n_interpolation_fallbacks.rb index 067601bcb..cdf248019 100644 --- a/lib/i18n_interpolation_fallbacks.rb +++ b/lib/i18n_interpolation_fallbacks.rb @@ -5,6 +5,7 @@ module I18n def translate(locale, key, options = {}) return super if options[:fallback] default = extract_string_or_lambda_default!(options) if options[:default] + options.merge!(:default => default) if default options[:fallback] = true I18n.fallbacks[locale].each do |fallback| @@ -16,7 +17,7 @@ module I18n end options.delete(:fallback) - return super(locale, nil, options.merge(:default => default)) if default + return super(locale, nil, options) if default raise(I18n::MissingInterpolationArgument.new(options, "key: #{key} in locale: #{locale}")) end end diff --git a/spec/support/i18n_raise_errors.rb b/spec/support/i18n_raise_errors.rb index 414867feb..915ddf919 100644 --- a/spec/support/i18n_raise_errors.rb +++ b/spec/support/i18n_raise_errors.rb @@ -1,6 +1,6 @@ module I18n def self.just_raise_that_exception(*args) - raise "Translation not found: #{args.first.key}" + raise "Translation not found: #{args.first.inspect}" end end