diff --git a/editor/translations/Makefile b/editor/translations/Makefile index bea20e877de..4f5d9f165fd 100644 --- a/editor/translations/Makefile +++ b/editor/translations/Makefile @@ -1,13 +1,13 @@ # Makefile providing various facilities to manage translations -TEMPLATE = tools.pot +TEMPLATE = editor.pot POFILES = $(wildcard *.po) LANGS = $(POFILES:%.po=%) all: update merge update: - @cd ../..; python2 tools/translations/extract.py + @cd ../..; python2 editor/translations/extract.py merge: @for po in $(POFILES); do \ diff --git a/editor/translations/tools.pot b/editor/translations/editor.pot similarity index 100% rename from editor/translations/tools.pot rename to editor/translations/editor.pot diff --git a/editor/translations/extract.py b/editor/translations/extract.py index 1192c190113..616fec17a0e 100755 --- a/editor/translations/extract.py +++ b/editor/translations/extract.py @@ -17,7 +17,7 @@ for arg in sys.argv[1:]: os.sys.exit("Non supported argument '" + arg + "'. Aborting.") -if (not os.path.exists("tools")): +if (not os.path.exists("editor")): os.sys.exit("ERROR: This script should be started from the root of the git repo.") @@ -51,7 +51,7 @@ msgstr "" "Content-Transfer-Encoding: 8-bit\\n" """ -print("Updating the tools.pot template...") +print("Updating the editor.pot template...") for fname in matches: @@ -102,20 +102,20 @@ for fname in matches: f.close() -f = open("tools.pot", "wb") +f = open("editor.pot", "wb") f.write(main_po) f.close() if (os.name == "posix"): print("Wrapping template at 79 characters for compatibility with Weblate.") - os.system("msgmerge -w79 tools.pot tools.pot > tools.pot.wrap") - shutil.move("tools.pot.wrap", "tools.pot") + os.system("msgmerge -w79 editor.pot editor.pot > editor.pot.wrap") + shutil.move("editor.pot.wrap", "editor.pot") -shutil.move("tools.pot", "tools/translations/tools.pot") +shutil.move("editor.pot", "editor/translations/editor.pot") # TODO: Make that in a portable way, if we care; if not, kudos to Unix users if (os.name == "posix"): - added = subprocess.check_output("git diff tools/translations/tools.pot | grep \+msgid | wc -l", shell=True) - removed = subprocess.check_output("git diff tools/translations/tools.pot | grep \\\-msgid | wc -l", shell=True) + added = subprocess.check_output("git diff editor/translations/editor.pot | grep \+msgid | wc -l", shell=True) + removed = subprocess.check_output("git diff editor/translations/editor.pot | grep \\\-msgid | wc -l", shell=True) print("\n# Template changes compared to the staged status:") print("# Additions: %s msgids.\n# Deletions: %s msgids." % (int(added), int(removed)))