summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2024-09-14 19:10:01 +0200
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-09-16 11:04:09 +0200
commitb579485d991da65ebe4a6cdbcab20f59f7515d3f (patch)
tree609e0e1742afeb1fecc9c6f2e3571426b295a4d7 /django/utils
parent1f3f0cd8cabd201063ac024cb72eea27ea8c4aa8 (diff)
Fixed #34221 -- Honored translation precedence with mixed plural forms.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/translation/trans_real.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index 1c42330451..1b163aab81 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -103,11 +103,9 @@ class TranslationCatalog:
yield from cat.keys()
def update(self, trans):
- # Merge if plural function is the same, else prepend.
- for cat, plural in zip(self._catalogs, self._plurals):
- if trans.plural.__code__ == plural.__code__:
- cat.update(trans._catalog)
- break
+ # Merge if plural function is the same as the top catalog, else prepend.
+ if trans.plural.__code__ == self._plurals[0]:
+ self._catalogs[0].update(trans._catalog)
else:
self._catalogs.insert(0, trans._catalog.copy())
self._plurals.insert(0, trans.plural)