translation file new generated
This commit is contained in:
parent
1359baff7b
commit
620b76f5f8
22
i18n.py
22
i18n.py
@ -34,13 +34,14 @@ def read_lua_file_strings(lua_file):
|
||||
|
||||
def inport_tr_file(tr_file):
|
||||
dOut = {}
|
||||
for line in open(tr_file, "r").readlines():
|
||||
s = line.strip()
|
||||
if s == "" or s[0] == "#":
|
||||
continue
|
||||
match = pattern_tr.match(s)
|
||||
if match:
|
||||
dOut[match.group(1)] = match.group(2)
|
||||
if os.path.exists(tr_file):
|
||||
for line in open(tr_file, "r").readlines():
|
||||
s = line.strip()
|
||||
if s == "" or s[0] == "#":
|
||||
continue
|
||||
match = pattern_tr.match(s)
|
||||
if match:
|
||||
dOut[match.group(1)] = match.group(2)
|
||||
return dOut
|
||||
|
||||
def generate_template(templ_file):
|
||||
@ -59,7 +60,8 @@ def generate_template(templ_file):
|
||||
|
||||
def update_tr_file(lNew, mod_name, tr_file):
|
||||
lOut = ["# textdomain: %s\n" % mod_name]
|
||||
shutil.copyfile(tr_file, tr_file+".old")
|
||||
if os.path.exists(tr_file):
|
||||
shutil.copyfile(tr_file, tr_file+".old")
|
||||
dOld = inport_tr_file(tr_file)
|
||||
for key in lNew:
|
||||
val = dOld.get(key, "")
|
||||
@ -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")
|
||||
|
@ -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
|
||||
|
@ -131,6 +131,7 @@ TA3 Derrick=
|
||||
TA3 Detector=
|
||||
TA3 Drill Bit=
|
||||
TA3 Ele Fab=
|
||||
TA3 Funnel=
|
||||
TA3 Furnace Firebox=
|
||||
TA3 Generator=
|
||||
TA3 Gravel Sieve=
|
||||
|
Loading…
x
Reference in New Issue
Block a user