mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-18319: gettext() can retrieve a message even if a plural form exists (#19869)
This commit is contained in:
parent
a2a0e51400
commit
54632528ee
3 changed files with 12 additions and 4 deletions
|
@ -422,10 +422,12 @@ class GNUTranslations(NullTranslations):
|
|||
missing = object()
|
||||
tmsg = self._catalog.get(message, missing)
|
||||
if tmsg is missing:
|
||||
if self._fallback:
|
||||
return self._fallback.gettext(message)
|
||||
return message
|
||||
return tmsg
|
||||
tmsg = self._catalog.get((message, self.plural(1)), missing)
|
||||
if tmsg is not missing:
|
||||
return tmsg
|
||||
if self._fallback:
|
||||
return self._fallback.gettext(message)
|
||||
return message
|
||||
|
||||
def ngettext(self, msgid1, msgid2, n):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue