UserGuidelines/Localisation: translate.cmd

File translate.cmd, 5.1 KB (added by Fran Boon, 10 years ago)

Windows script to manage updates to translations

Line 
1@echo off
2c:
3cd \temp
4md lang
5cd lang
6
7rem Download the existing files from Pootle
8rem Convert them to Web2Py format
9
10rem wget http://pootle.sahanafoundation.org/pootle/export/eden/ar/ar.po
11rem c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i ar.po -o ar.py
12rem wget http://pootle.sahanafoundation.org/pootle/export/eden/de/de.po
13rem c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i de.po -o de.py
14wget http://pootle.sahanafoundation.org/pootle/export/eden/el/el.po
15c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i el.po -o el.py
16rem wget http://pootle.sahanafoundation.org/pootle/export/eden/en_GB/en-gb.po
17rem c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i en-gb.po -o en-gb.py
18wget http://pootle.sahanafoundation.org/pootle/export/eden/es/es.po
19c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i es.po -o es.py
20wget http://pootle.sahanafoundation.org/pootle/export/eden/fr/fr.po
21c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i fr.po -o fr.py
22rem wget http://pootle.sahanafoundation.org/pootle/export/eden/it/it.po
23rem c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i it.po -o it.py
24wget http://pootle.sahanafoundation.org/pootle/export/eden/ja/ja.po
25c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i ja.po -o ja.py
26rem wget http://pootle.sahanafoundation.org/pootle/export/eden/ko/ko.po
27rem c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i ko.po -o ko.py
28rem wget http://pootle.sahanafoundation.org/pootle/export/eden/pt/pt.po
29rem c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i pt.po -o pt.py
30rem wget http://pootle.sahanafoundation.org/pootle/export/eden/pt_BR/pt-br.po
31rem c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i pt-br.po -o pt-br.py
32rem wget http://pootle.sahanafoundation.org/pootle/export/eden/ru/ru.po
33rem c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i ru.po -o ru.py
34wget http://pootle.sahanafoundation.org/pootle/export/eden/ur/ur.po
35c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i ur.po -o ur.py
36wget http://pootle.sahanafoundation.org/pootle/export/eden/vi/vi.po
37c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i vi.po -o vi.py
38rem wget http://pootle.sahanafoundation.org/pootle/export/eden/zh_CN/zh-cn.po
39rem c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i zh-cn.po -o zh-cn.py
40wget http://pootle.sahanafoundation.org/pootle/export/eden/zh_TW/zh-tw.po
41c:\bin\python26\python.exe c:\bin\python26\Scripts\po2web2py -i zh-tw.po -o zh-tw.py
42
43
44rem Update the files to include the latest strings from the source
45rem This also ensures that we convert from UTF-8 Hex to UTF-8 (without BOM)
46rem (as if we ran the application with the language set)
47
48cd \temp\lang
49copy /y *.py \bin\web2py\applications\eden\languages\
50
51cd \bin\web2py
52python web2py.py -S eden -R applications\eden\static\scripts\tools\languages.py
53rem pofilter -i es_raw.po -o es_unchanged.po -t unchanged --nonotes
54rem pomerge -i es_unchanged.po -o es.po -t es_raw.po
55
56
57rem Convert the Web2Py files back to PO to upload back to Pootle (Merge mode)
58
59cd \temp\lang
60md out
61cd out
62c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\ar.py -o ar.po
63c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\de.py -o de.po
64c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\el.py -o el.po
65rem c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\en-gb.py -o en-gb.po
66c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\es.py -o es.po
67c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\fr.py -o fr.po
68c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\it.py -o it.po
69c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\ja.py -o ja.po
70c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\ko.py -o ko.po
71rem c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\pt.py -o pt.po
72c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\pt-br.py -o pt-br.po
73c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\ru.py -o ru.po
74c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\ur.py -o ur.po
75c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\vi.py -o vi.po
76c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\zh-cn.py -o zh-cn.po
77c:\bin\python26\python.exe c:\bin\python26\Scripts\web2py2po -i \bin\web2py\applications\eden\languages\zh-tw.py -o zh-tw.po