diff --git a/lib/i18n/backend/simple.rb b/lib/i18n/backend/simple.rb index 0c49de8f..e4ab2dc7 100644 --- a/lib/i18n/backend/simple.rb +++ b/lib/i18n/backend/simple.rb @@ -94,7 +94,7 @@ def lookup(locale, key, scope = [], options = EMPTY_HASH) return nil unless result.has_key?(_key) end result = result[_key] - result = resolve_entry(locale, _key, result, options.merge(:scope => nil)) if result.is_a?(Symbol) + result = resolve_entry(locale, _key, result, Utils.except(options.merge(:scope => nil), :count)) if result.is_a?(Symbol) result end end diff --git a/test/backend/pluralization_test.rb b/test/backend/pluralization_test.rb index d955818e..1e61b944 100644 --- a/test/backend/pluralization_test.rb +++ b/test/backend/pluralization_test.rb @@ -47,4 +47,14 @@ def setup test "Fallbacks can pick up rules from fallback locales, too" do assert_equal @rule, I18n.backend.send(:pluralizer, :'xx-XX') end + + test "linked lookup works with pluralization backend" do + I18n.backend.store_translations(:xx, { + :automobiles => :autos, + :autos => :cars, + :cars => { :porsche => { :one => "I have %{count} Porsche 🚗", :other => "I have %{count} Porsches 🚗" } } + }) + assert_equal "I have 1 Porsche 🚗", I18n.t(:'automobiles.porsche', count: 1, :locale => :xx) + assert_equal "I have 20 Porsches 🚗", I18n.t(:'automobiles.porsche', count: 20, :locale => :xx) + end end