FIX: Looking up translation overrides by symbol failed when count is used (#12896)

This commit is contained in:
Gerhard Schlager
2021-04-30 13:54:45 +02:00
committed by GitHub
parent 0188d53f3a
commit 4f36f604c8
2 changed files with 8 additions and 1 deletions

View File

@ -91,6 +91,7 @@ module I18n
return existing_translations if scope.is_a?(Array) && scope.include?(:models)
overrides = options.dig(:overrides, locale)
key = key.to_s
if overrides
if options[:count]
@ -112,7 +113,7 @@ module I18n
result = {}
remapped_translations.merge(overrides).each do |k, v|
result[k.split('.').last.to_sym] = v if k != key && k.start_with?(key.to_s)
result[k.split('.').last.to_sym] = v if k != key && k.start_with?(key)
end
return result if result.size > 0
end