diff options
Diffstat (limited to 'ledit')
-rwxr-xr-x | ledit/posplit.py | 9 |
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) |