mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Actually fix the context translation issue
This commit is contained in:
parent
224ca73fef
commit
6e985be8be
|
@ -22,7 +22,10 @@ logger = logging.getLogger("rcgcdw.i18n")
|
||||||
|
|
||||||
def python37_pgettext_backward_compatibility(context: str, string: str):
|
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"""
|
"""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:
|
try:
|
||||||
if settings["lang"] != "en":
|
if settings["lang"] != "en":
|
||||||
|
|
Loading…
Reference in a new issue