The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

update_translations.py in scripts

This file is a part of the Birdfont project.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git

Revisions

View the latest version of scripts/update_translations.py.
Remove old SVG parser code
1 #!/usr/bin/python3 2 import subprocess 3 import os 4 5 def task_update_translations (): 6 subprocess.check_output ("xgettext --language=vala --keyword=t_ --add-comments=/ --from-code=utf-8 --output=./po/birdfont.pot ./libbirdfont/*.vala ./birdfont/*.vala ./birdfont-export/*.vala ./birdfont-autotrace/*.vala", shell=True) 7 8 for file in os.listdir('./po'): 9 if file == "birdfont.pot": continue 10 11 try: 12 if file.index ('.po') == -1: continue 13 except: 14 continue 15 16 loc = file.replace (".po", "") 17 d = "./po/" + loc + ".po" 18 19 subprocess.check_output ("wget -O build/" + loc + ".po.zip http://pootle.locamotion.org/" + loc + "/birdfont/export/zip", shell=True) 20 subprocess.check_output ("unzip build/" + loc + ".po.zip", shell=True) 21 subprocess.check_output ("mv " + loc + ".po " + d, shell=True) 22 23 subprocess.check_output ("msgmerge " + d + " ./po/birdfont.pot > " + loc + ".po.new", shell=True) 24 subprocess.check_output ("mv " + loc + ".po.new " + d, shell=True) 25 26 return { 27 'actions': ['echo "done updating translations"'], 28 } 29 30 31 task_update_translations () 32