Add Czech translation for Sahana

Add a script to convert Sahana translation XLS to python format
This commit is contained in:
Disassembler 2017-08-31 11:27:57 +02:00
parent 5c30cc871a
commit 567443260c
2 changed files with 8201 additions and 0 deletions

26
sahana/sahana-lang-csv.py Normal file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env python
import csv
dictionary = {}
with open('cz.csv', 'rb') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='\'')
for line in reader:
dictionary[line[1]] = line[2]
with open('cz.py', 'wb') as langfile:
langfile.write(str(dictionary))
--
import xlrd
from pprint import pprint
dictionary = {}
sheet = xlrd.open_workbook('cz.xls').sheet_by_index(0)
for i in range(1, sheet.nrows):
row = sheet.row(i)
dictionary[row[1].value.encode('utf-8')] = row[2].value.encode('utf-8')
with open('cz.py', 'wb') as langfile:
pprint(dictionary, langfile)

File diff suppressed because it is too large Load Diff