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

Method pgettext

Lib/gettext.py:461–471  ·  view source on GitHub ↗
(self, context, message)

Source from the content-addressed store, hash-verified

459 return tmsg
460
461 def pgettext(self, context, message):
462 ctxt_msg_id = self.CONTEXT % (context, message)
463 missing = object()
464 tmsg = self._catalog.get(ctxt_msg_id, missing)
465 if tmsg is missing:
466 tmsg = self._catalog.get((ctxt_msg_id, self.plural(1)), missing)
467 if tmsg is not missing:
468 return tmsg
469 if self._fallback:
470 return self._fallback.pgettext(context, message)
471 return message
472
473 def npgettext(self, context, msgid1, msgid2, n):
474 ctxt_msg_id = self.CONTEXT % (context, msgid1)

Callers 4

test_translationsMethod · 0.95
pgettextMethod · 0.45
dpgettextFunction · 0.45

Calls 2

getMethod · 0.45
pluralMethod · 0.45

Tested by 2

test_translationsMethod · 0.76