Import gettext-related methods, instead of monkeypatching builtins

This commit is contained in:
Laurent Monin
2024-04-20 23:42:17 +02:00
parent ebfd011a99
commit fada4f0a40
148 changed files with 944 additions and 571 deletions

View File

@@ -382,9 +382,10 @@ class picard_build_ui(Command):
tmp = StringIO()
uic.compileUi(uifile, tmp)
source = tmp.getvalue()
rc = re.compile(r'\n\n#.*?(?=\n\n)', re.MULTILINE | re.DOTALL)
comment = ("\n\n# Automatically generated - don't edit.\n"
"# Use `python setup.py %s` to update it."
rc = re.compile(r'\n# WARNING.*?(?=\n\n)', re.MULTILINE | re.DOTALL)
comment = ("\n# Automatically generated - do not edit.\n"
"# Use `python setup.py %s` to update it.\n\n"
"from picard.i18n import _"
% _get_option_name(self))
for r in list(_translate_re):
source = r.sub(r'_(\1)', source)