From 6e985be8be56e049e9ecf68866014a862fde1c9b Mon Sep 17 00:00:00 2001 From: Frisk Date: Sat, 22 May 2021 21:42:09 +0200 Subject: [PATCH] Actually fix the context translation issue --- src/i18n.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/i18n.py b/src/i18n.py index 6e16512..b2a6e7c 100644 --- a/src/i18n.py +++ b/src/i18n.py @@ -22,7 +22,10 @@ logger = logging.getLogger("rcgcdw.i18n") def python37_pgettext_backward_compatibility(context: str, string: str): """Creates backward compatibility with Python 3.7 as pgettext has been introduced only in Python 3.8""" - return formatters_i18n.gettext(string) + translation = formatters_i18n.gettext("{}\x04{}".format(context, string)) + if "\x04" in translation: # gettext returned same message + return string + return translation try: if settings["lang"] != "en":