MCPcopy Index your code
hub / github.com/RustPython/RustPython / npgettext

Method npgettext

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

Source from the content-addressed store, hash-verified

471 return message
472
473 def npgettext(self, context, msgid1, msgid2, n):
474 ctxt_msg_id = self.CONTEXT % (context, msgid1)
475 try:
476 tmsg = self._catalog[ctxt_msg_id, self.plural(n)]
477 except KeyError:
478 if self._fallback:
479 return self._fallback.npgettext(context, msgid1, msgid2, n)
480 if n == 1:
481 tmsg = msgid1
482 else:
483 tmsg = msgid2
484 return tmsg
485
486
487# Locate a .mo file using the gettext strategy

Callers 4

test_translationsMethod · 0.95
npgettextMethod · 0.45
dnpgettextFunction · 0.45

Calls 1

pluralMethod · 0.45

Tested by 2

test_translationsMethod · 0.76