summaryrefslogtreecommitdiff
path: root/ledit
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2024-08-30 17:49:38 -0300
committerJesusaves <cpntb1@ymail.com>2024-08-30 17:49:38 -0300
commit76f737cc0c4afb58abe3e458a31292defc80a694 (patch)
treec1a410b7e6900f72cfa582cad58907161eff5243 /ledit
parent17bd9fd9c586d7c9cd2009934b015b59b8c273ae (diff)
downloadtools-76f737cc0c4afb58abe3e458a31292defc80a694.tar.gz
tools-76f737cc0c4afb58abe3e458a31292defc80a694.tar.bz2
tools-76f737cc0c4afb58abe3e458a31292defc80a694.tar.xz
tools-76f737cc0c4afb58abe3e458a31292defc80a694.zip
Update posplit.py to output stuff to out/ directory
Diffstat (limited to 'ledit')
-rwxr-xr-xledit/posplit.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ledit/posplit.py b/ledit/posplit.py
index 5020377..529334d 100755
--- a/ledit/posplit.py
+++ b/ledit/posplit.py
@@ -7,14 +7,17 @@
import traceback, sys, time, os
import polib
+## Create directory if it doesn't exist out
+os.makedirs("out", exist_ok=True)
+
## The file which we're splitting; to merge use msgcat
if len(sys.argv) >= 2:
fn = sys.argv[1]
else:
- fn="../for_translation_moubootaur-legends_serverdata_de.po"
+ fn="in.po"
## Open the PO file and report current completion
-print("Opening \"%s\"...", fn)
+print("Opening \"%s\"..." % fn)
po=polib.pofile(fn)
cnt=0
print("Current string count: %d" % len(po))
@@ -59,7 +62,7 @@ for k in domains:
wc+=len(w.msgid.split())
print("\033[1m%s\033[0m: %s%% completed, %d strings, %d words" % (k, str(deeds[k].percent_translated()), len(deeds[k]), wc))
if wc > 0:
- deeds[k].save('domain_%s.po' % k)
+ deeds[k].save('out/domain_%s.po' % k)
else:
print("\033[31;1m%s was not saved.\033[0m" % k)