annotate MoinMoin/i18n/wiki2po.py @ 202:76c22aae6a64

i18n: added fa (Farsi, Persian), fixed nl imported from: moin--main--1.5--patch-204
author Thomas Waldmann <tw@waldmann-edv.de>
date Tue, 08 Nov 2005 23:18:00 +0000
parents e8da71f39a92
children be33ecd58d4e
rev   line source
162
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1 #!/usr/bin/python
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
2 """
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
3 get latest translation page content from the wiki and write it to *.po
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
4 """
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
5 import sys, xmlrpclib
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
6 sys.path.insert(0, '../..')
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
7
202
76c22aae6a64 i18n: added fa (Farsi, Persian), fixed nl
Thomas Waldmann <tw@waldmann-edv.de>
parents: 162
diff changeset
8 excluded = ["en",] # languages managed in tla repository, not in wiki
162
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
9
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
10 langfname = sys.argv[1]
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
11 lang = langfname.replace('_', '-') # module names use _ instead of -
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
12
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
13 if not lang in excluded:
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
14 wiki = xmlrpclib.ServerProxy("http://moinmaster.wikiwikiweb.de/?action=xmlrpc2")
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
15
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
16 pagename = "MoinI18n/%s" % lang
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
17 pagedata = wiki.getPage(pagename).encode('utf-8').replace("\n","\r\n")
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
18
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
19 f = open("%s.po" % langfname, "w")
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
20 f.write(pagedata)
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
21 f.close()
e8da71f39a92 added wiki2po script, updated i18n
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
22