From b5c0d0b7b3b222db1ae32677ed86c0dd36638b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 4 Feb 2023 13:26:32 +0800 Subject: [PATCH] Added the pgettext function to the "accounting.locale" module. --- src/accounting/locale.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/accounting/locale.py b/src/accounting/locale.py index 380446e..88e528d 100644 --- a/src/accounting/locale.py +++ b/src/accounting/locale.py @@ -39,6 +39,17 @@ def gettext(string, **variables) -> str: return domain.gettext(string, **variables) +def pgettext(context, string, **variables) -> str: + """A replacement of the Babel gettext() function.. + + :param context: The context. + :param string: The message to translate. + :param variables: The variable substitution. + :return: The translated message. + """ + return domain.pgettext(context, string, **variables) + + def lazy_gettext(string, **variables) -> LazyString: """A replacement of the Babel lazy_gettext() function..