view MoinMoin/i18n/tools/wiki2po.py @ 1662:3338af3c3867

update i18n, fix i18n tools
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 01 Nov 2006 23:55:39 +0100
parents 277695e8e6f5
children b551fc405222
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

    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
        print pagename
        pagedata = wiki.getPage(pagename).encode('utf-8').replace("\n", "\r\n")

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

if __name__ == "__main__":
    run()