[Editor] Handle spaces in paths when generating translations

This commit is contained in:
A Thousand Ships
2026-01-14 12:42:36 +01:00
parent 481f36ed20
commit 277afe074b

View File

@@ -85,7 +85,7 @@ def make_translations(target, source, env):
# msgfmt erases non-translated messages, so avoid using it if exporting the POT.
if msgfmt and name != category:
mo_path = os.path.join(tempfile.gettempdir(), uuid.uuid4().hex + ".mo")
cmd = f"{msgfmt} {path} --no-hash -o {mo_path}"
cmd = f'{msgfmt} "{path}" --no-hash -o "{mo_path}"'
try:
subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE).communicate()
buffer = methods.get_buffer(mo_path)