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.
Create new paths in pen tool
1 #!/usr/bin/python 2 import subprocess 3 import os 4 5 def task_update_translations (): 6 subprocess.check_output ("xgettext --language=C# --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 if not file.find ('skip') == -1: continue 11 12 loc = file.replace (".po", "") 13 d = "./po/" + loc + ".po" 14 15 subprocess.check_output ("wget -O build/" + loc + ".po.zip http://pootle.locamotion.org/" + loc + "/birdfont/export/zip", shell=True) 16 subprocess.check_output ("unzip build/" + loc + ".po.zip", shell=True) 17 subprocess.check_output ("mv " + loc + ".po " + d, shell=True) 18 19 subprocess.check_output ("msgmerge " + d + " ./po/birdfont.pot > " + loc + ".po.new", shell=True) 20 subprocess.check_output ("mv " + loc + ".po.new " + d, shell=True) 21 22 return { 23 'actions': ['echo "done updating translations"'], 24 } 25 26 27 task_update_translations () 28