Adding locales and the script used ot generate them
This commit is contained in:
parent
2faa769a1f
commit
2fd4c32ce7
|
@ -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)
|
|
@ -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
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Knochen
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Ostoj
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Huesos
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Ossements
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Csontok
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Tulang
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Ossa
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=骨
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=gunma lo'i bongu
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Tulang
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Botten
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Kości
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Ossos
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Ossos
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Oase
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Кости
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Кости
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Kemikler
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=Мощі
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=骨头
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# textdomain: bones
|
||||
|
||||
Bones=
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
# textdomain: bucket
|
||||
|
||||
Empty Bucket=Пустое вядро
|
||||
|
||||
Water Bucket=Вядро вады
|
||||
|
||||
River Water Bucket=Вядро рачной вады
|
||||
|
||||
Lava Bucket=Вядро лавы
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
# textdomain: bucket
|
||||
|
||||
Empty Bucket=Prázdný kbelík
|
||||
|
||||
Water Bucket=Kbelík s vodou
|
||||
|
||||
River Water Bucket=Kbelík s říční vodou
|
||||
|
||||
Lava Bucket=Kbelík s lávou
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
# textdomain: bucket
|
||||
|
||||
Empty Bucket=Leerer Eimer
|
||||
|
||||
Water Bucket=Wassereimer
|
||||
|
||||
River Water Bucket=Flusswassereimer
|
||||
|
||||
Lava Bucket=Lavaeimer
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue