Merge pull request #114943 from AThousandShips/fix_msgfmt_spaces

[Editor] Handle spaces in paths when generating translations
This commit is contained in:
Thaddeus Crews 2026-01-26 13:14:37 -06:00
commit 780b6891e6
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

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)