diff --git a/squirrelbattle/translations.py b/squirrelbattle/translations.py index 5ce8986..d5ac3e2 100644 --- a/squirrelbattle/translations.py +++ b/squirrelbattle/translations.py @@ -3,6 +3,7 @@ import gettext as gt import os +import re import subprocess from pathlib import Path from typing import Any, List @@ -68,9 +69,14 @@ class Translator: "--copyright-holder=ÿnérant, eichhornchen, " "nicomarg, charlse", "--msgid-bugs-address=squirrel-battle@crans.org", + "--sort-by-file", "-o", file_name] if file_name.is_file(): args.append("--join-existing") + with open(file_name, "r") as f: + content = f.read() + with open(file_name, "w") as f: + f.write(re.sub("#:.*\n", "", content)) print(f"Make {language} messages...") subprocess.Popen(args, stdin=find.stdout).wait()