translation file new generated

This commit is contained in:
Joachim Stolberg 2019-09-28 19:47:06 +02:00
parent 1359baff7b
commit 620b76f5f8
3 changed files with 14 additions and 10 deletions

View File

@ -34,6 +34,7 @@ def read_lua_file_strings(lua_file):
def inport_tr_file(tr_file):
dOut = {}
if os.path.exists(tr_file):
for line in open(tr_file, "r").readlines():
s = line.strip()
if s == "" or s[0] == "#":
@ -59,6 +60,7 @@ def generate_template(templ_file):
def update_tr_file(lNew, mod_name, tr_file):
lOut = ["# textdomain: %s\n" % mod_name]
if os.path.exists(tr_file):
shutil.copyfile(tr_file, tr_file+".old")
dOld = inport_tr_file(tr_file)
for key in lNew:
@ -71,8 +73,8 @@ def update_tr_file(lNew, mod_name, tr_file):
open(tr_file, "w").write("\n".join(lOut))
data = generate_template("./locale/template.txt")
update_tr_file(data, "techage", "./locale/techage.de.tr")
update_tr_file(data, "techage", "./locale/techage.fr.tr")
#update_tr_file(data, "mymod", "./locale/mymod.de.tr")
#update_tr_file(data, "mymod", "./locale/mymod.fr.tr")
update_tr_file(data, "techage", "./locale/techage.de.tr")
update_tr_file(data, "techage", "./locale/techage.fr.tr")
print("Done.\n")

View File

@ -133,6 +133,7 @@ TA3 Derrick=TA3 Bohrturm
TA3 Detector=TA3 Detektor
TA3 Drill Bit=TA3 Bohrgestänge
TA3 Ele Fab=TA3 E-Fabrik
TA3 Funnel=TA3 Trichter
TA3 Furnace Firebox=TA3 Ofen-Feuerkiste
TA3 Generator=TA3 Generator
TA3 Gravel Sieve=TA3 Kiessieb

View File

@ -131,6 +131,7 @@ TA3 Derrick=
TA3 Detector=
TA3 Drill Bit=
TA3 Ele Fab=
TA3 Funnel=
TA3 Furnace Firebox=
TA3 Generator=
TA3 Gravel Sieve=