mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 19:56:20 +00:00
bonsai_translations - use utf-8 for opening files
Critical on Windows as it's not using utf-8 by default
This commit is contained in:
@@ -184,7 +184,7 @@ def update_translations_from_po(po_directory: Path, translations_module: Path):
|
|||||||
for po_file_path in po_directory.glob("**/*.po"):
|
for po_file_path in po_directory.glob("**/*.po"):
|
||||||
lang = po_file_path.stem
|
lang = po_file_path.stem
|
||||||
langs.add(lang)
|
langs.add(lang)
|
||||||
with open(po_file_path, "r") as po_file:
|
with open(po_file_path, "r", encoding="utf-8") as po_file:
|
||||||
current_chunk = []
|
current_chunk = []
|
||||||
for line in po_file:
|
for line in po_file:
|
||||||
current_chunk.append(line)
|
current_chunk.append(line)
|
||||||
@@ -210,7 +210,7 @@ def update_translations_from_po(po_directory: Path, translations_module: Path):
|
|||||||
|
|
||||||
ret.append("}")
|
ret.append("}")
|
||||||
|
|
||||||
with open(translations_module / "translations.py", "w") as fo:
|
with open(translations_module / "translations.py", "w", encoding="utf-8") as fo:
|
||||||
fo.write("\n".join(ret))
|
fo.write("\n".join(ret))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user