MCPcopy Index your code
hub / github.com/python/cpython / ngettext

Method ngettext

Lib/gettext.py:450–460  ·  view source on GitHub ↗
(self, msgid1, msgid2, n)

Source from the content-addressed store, hash-verified

448 return message
449
450 def ngettext(self, msgid1, msgid2, n):
451 try:
452 tmsg = self._catalog[(msgid1, self.plural(n))]
453 except KeyError:
454 if self._fallback:
455 return self._fallback.ngettext(msgid1, msgid2, n)
456 if n == 1:
457 tmsg = msgid1
458 else:
459 tmsg = msgid2
460 return tmsg
461
462 def pgettext(self, context, message):
463 ctxt_msg_id = self.CONTEXT % (context, message)

Callers 4

test_translationsMethod · 0.95
ngettextMethod · 0.45
dngettextFunction · 0.45

Calls 1

pluralMethod · 0.45

Tested by 2

test_translationsMethod · 0.76