Adding locales and the script used ot generate them

This commit is contained in:
Yves Quemener 2019-09-07 15:26:22 +09:00
parent 2faa769a1f
commit 2fd4c32ce7
721 changed files with 15519 additions and 0 deletions

63
locale/dispatch.py Normal file
View File

@ -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)

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Незвычайны ложак
Simple Bed=Просты ложак

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Zdobená postel
Simple Bed=Prostá postel

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Schönes Bett
Simple Bed=Schlichtes Bett

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=
Simple Bed=

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Luksa lito
Simple Bed=Simpla lito

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Cama sofisticada
Simple Bed=Cama sencilla

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Lit fantaisie
Simple Bed=Lit Simple

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Csinos ágy
Simple Bed=Egyszerű ágy

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Dipan Mewah
Simple Bed=Dipan Sederhana

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Letto elegante
Simple Bed=Letto semplice

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=お洒落なベッド
Simple Bed=簡素なベッド

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=se jadni ckana
Simple Bed=sampu ckana

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Katil Beragam
Simple Bed=Katil Biasa

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Mooi Bed
Simple Bed=Simpel bed

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Łóżko ozdobne
Simple Bed=Proste łóżko

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Cama com Cabeceira
Simple Bed=Cama Simples

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Cama com Cabeceira
Simple Bed=Cama Simples

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Pat Luxos
Simple Bed=Pat Simplu

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Необычная кровать
Simple Bed=Обычная кровать

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Китњаст кревет
Simple Bed=Једноставан кревет

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Süslü Yatak
Simple Bed=Basit Yatak

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=Чепурне Ліжко
Simple Bed=Просте Ліжко

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=豪华大床
Simple Bed=简单的床

View File

@ -0,0 +1,6 @@
# textdomain: beds
Fancy Bed=
Simple Bed=

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,2 @@
# textdomain: binoculars

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Човен

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Loďka

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Boot

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Boato

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Bote

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Bateau

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Csónak

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Kapal

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=zattera

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=ボート

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=bloti

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Bot

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Boot

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Łódka

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Bote de Madeira

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Bote de Madeira

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Barcă

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Лодка

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Брод

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Tekne

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=Човен

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=船

View File

@ -0,0 +1,4 @@
# textdomain: boats
Boat=

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Косці

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Kosti

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Knochen

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Ostoj

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Huesos

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Ossements

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Csontok

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Tulang

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Ossa

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=骨

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=gunma lo'i bongu

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Tulang

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Botten

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Kości

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Ossos

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Ossos

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Oase

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Кости

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Кости

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Kemikler

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=Мощі

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=骨头

View File

@ -0,0 +1,4 @@
# textdomain: bones
Bones=

View File

@ -0,0 +1,10 @@
# textdomain: bucket
Empty Bucket=Пустое вядро
Water Bucket=Вядро вады
River Water Bucket=Вядро рачной вады
Lava Bucket=Вядро лавы

View File

@ -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

View File

@ -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