Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Yves Quemener | 5baf5c1c51 | |
Yves Quemener | 2fd4c32ce7 |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,63 @@
|
|||
# Transforms the generic po file produced by weblate into a series of
|
||||
# locale/[modname].ja.tr files.
|
||||
|
||||
# TODO: make it work for all languages!
|
||||
|
||||
import os
|
||||
import re
|
||||
from collections import defaultdict
|
||||
|
||||
strings=dict()
|
||||
modstr=defaultdict(list)
|
||||
for modname in os.listdir("../mods/"):
|
||||
for fn in os.listdir("../mods/"+modname):
|
||||
if fn.endswith(".lua"):
|
||||
s=open("../mods/"+modname+"/"+fn).read()
|
||||
for gtstring in re.findall("S\(.*\)", s):
|
||||
k=gtstring[3:-2]
|
||||
strings[k]=modname
|
||||
modstr[modname].append(k)
|
||||
"""
|
||||
for m in modstr.keys():
|
||||
print(m)
|
||||
for v in modstr[m]:
|
||||
print("\t"+v)
|
||||
"""
|
||||
locales = list()
|
||||
for fn in os.listdir("."):
|
||||
if fn .endswith(".po"):
|
||||
locales.append(fn[:-3])
|
||||
print(locales)
|
||||
|
||||
notused=set()
|
||||
for loc in locales:
|
||||
matches = 0
|
||||
nom = 0
|
||||
msgid = None
|
||||
translation = dict()
|
||||
for line in open(loc+".po"):
|
||||
match = re.match('[^#]*msgstr[ \t]+"(.*)"', line)
|
||||
if match and msgid is not None:
|
||||
translation[msgid]=match.group(1)
|
||||
match = re.match('[^#]*msgid[ \t]+"(.*)"', line)
|
||||
if match:
|
||||
msgid = match.group(1)
|
||||
if msgid in strings:
|
||||
matches+=1
|
||||
else:
|
||||
nom+=1
|
||||
notused.add(msgid)
|
||||
else:
|
||||
msgid=None
|
||||
|
||||
print("{}: {}/{}".format(loc, matches, matches+nom))
|
||||
|
||||
for modname in os.listdir("../mods/"):
|
||||
os.makedirs("../mods/{0}/locale".format(modname), exist_ok=True)
|
||||
localefile = open("../mods/{0}/locale/{0}.{1}.tr".format(modname, loc), "w")
|
||||
localefile.write("# textdomain: "+modname+"\n\n")
|
||||
for k in modstr[modname]:
|
||||
if k in translation:
|
||||
localefile.write("{}={}\n\n".format(k,translation[k]))
|
||||
localefile.close()
|
||||
print(notused)
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Незвычайны ложак
|
||||
|
||||
Simple Bed=Просты ложак
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Zdobená postel
|
||||
|
||||
Simple Bed=Prostá postel
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Schönes Bett
|
||||
|
||||
Simple Bed=Schlichtes Bett
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=
|
||||
|
||||
Simple Bed=
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Luksa lito
|
||||
|
||||
Simple Bed=Simpla lito
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Cama sofisticada
|
||||
|
||||
Simple Bed=Cama sencilla
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Lit fantaisie
|
||||
|
||||
Simple Bed=Lit Simple
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Csinos ágy
|
||||
|
||||
Simple Bed=Egyszerű ágy
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Dipan Mewah
|
||||
|
||||
Simple Bed=Dipan Sederhana
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Letto elegante
|
||||
|
||||
Simple Bed=Letto semplice
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=お洒落なベッド
|
||||
|
||||
Simple Bed=簡素なベッド
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=se jadni ckana
|
||||
|
||||
Simple Bed=sampu ckana
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Katil Beragam
|
||||
|
||||
Simple Bed=Katil Biasa
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Mooi Bed
|
||||
|
||||
Simple Bed=Simpel bed
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Łóżko ozdobne
|
||||
|
||||
Simple Bed=Proste łóżko
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Cama com Cabeceira
|
||||
|
||||
Simple Bed=Cama Simples
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Cama com Cabeceira
|
||||
|
||||
Simple Bed=Cama Simples
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Pat Luxos
|
||||
|
||||
Simple Bed=Pat Simplu
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Необычная кровать
|
||||
|
||||
Simple Bed=Обычная кровать
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Китњаст кревет
|
||||
|
||||
Simple Bed=Једноставан кревет
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Süslü Yatak
|
||||
|
||||
Simple Bed=Basit Yatak
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=Чепурне Ліжко
|
||||
|
||||
Simple Bed=Просте Ліжко
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=豪华大床
|
||||
|
||||
Simple Bed=简单的床
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# textdomain: beds
|
||||
|
||||
Fancy Bed=
|
||||
|
||||
Simple Bed=
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# textdomain: binoculars
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Човен
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Loďka
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Boot
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Boato
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Bote
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Bateau
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Csónak
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Kapal
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=zattera
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=ボート
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=bloti
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Bot
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Boot
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Łódka
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Bote de Madeira
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Bote de Madeira
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Barcă
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Лодка
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Брод
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Tekne
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=Човен
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=船
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: boats
|
||||
|
||||
Boat=
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Косці
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Kosti
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue