diff MoinMoin/i18n/wiki2po.py @ 162:e8da71f39a92

added wiki2po script, updated i18n imported from: moin--main--1.5--patch-164
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 30 Oct 2005 12:11:27 +0000
parents
children 76c22aae6a64
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/i18n/wiki2po.py	Sun Oct 30 12:11:27 2005 +0000
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+"""
+    get latest translation page content from the wiki and write it to *.po
+"""
+import sys, xmlrpclib
+sys.path.insert(0, '../..')
+
+excluded = ["en", "he"] # languages managed in tla repository, not in wiki
+
+langfname = sys.argv[1]
+lang = langfname.replace('_', '-') # module names use _ instead of -
+
+if not lang in excluded:
+    wiki = xmlrpclib.ServerProxy("http://moinmaster.wikiwikiweb.de/?action=xmlrpc2")
+
+    pagename = "MoinI18n/%s" % lang
+    pagedata = wiki.getPage(pagename).encode('utf-8').replace("\n","\r\n")
+
+    f = open("%s.po" % langfname, "w")
+    f.write(pagedata)
+    f.close()
+