Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- import os.path
- import subprocess
- ZIP_FILE = "sugar-locale.zip"
- def download():
- subprocess.call([ "wget",
- "http://translate.sugarlabs.org/zh_CN/glucose/export/zip",
- "-O", "sugar-locale.zip" ])
- def unpack():
- subprocess.call([ "unzip", ZIP_FILE ])
- def compile_po():
- for po in os.listdir('.'):
- if not po.endswith(".po"):
- continue
- mo = po.replace(".po", ".mo")
- subprocess.call([ "msgfmt", "-o", mo, po ])
- if __name__ == '__main__':
- download()
- unpack()
- compile_po()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement