Add Czech translation for Sahana
Add a script to convert Sahana translation XLS to python format
This commit is contained in:
parent
5c30cc871a
commit
567443260c
26
sahana/sahana-lang-csv.py
Normal file
26
sahana/sahana-lang-csv.py
Normal 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)
|
8175
sahana/srv/sahana/applications/eden/languages/cz.py
Normal file
8175
sahana/srv/sahana/applications/eden/languages/cz.py
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user