view MoinMoin/i18n/tools/wiki2po.py @ 3080:7dcd8b937fd0

small fixes to i18n maintainer mailings script and text (ported from 1.6 and updated for 1.7)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 22 Feb 2008 22:46:10 +0100
parents b1e7d968330d
children cd6cfc715261
line wrap: on
line source

#!/usr/bin/python
"""
    get latest translation page content from the wiki and write it to *.po
"""
DOMAIN = "MoinMoin"

def run():
    import sys, xmlrpclib
    sys.path.insert(0, '../..')

    excluded = ["en", ] # languages managed in repository, not in wiki

    lang = sys.argv[1]

    if not lang in excluded:
        wiki = xmlrpclib.ServerProxy("http://moinmaster.wikiwikiweb.de/?action=xmlrpc2")

        pagename = "MoinI18n/%s" % lang
        print pagename
        pagedata = wiki.getPage(pagename).encode('utf-8').replace("\n", "\r\n")

        f = open("%s.%s.po" % (lang, DOMAIN), "w")
        f.write(pagedata)
        f.close()

if __name__ == "__main__":
    run()