diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-20 21:07:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-20 21:07:33 +0400 |
commit | 8cf8fd7326f0961bad2cd633092fccbcadf0cc92 (patch) | |
tree | d3ea45fcf0ea4a6a242a5c942a06caf01fac6d55 /po/update_po.py | |
parent | 9d1b4b63b33b77505f4399a4db4f462f5b1fd1eb (diff) |
- translation scripts now run with py3.x
- added convenience make target 'make translations'
- some MEM_malloc strings were not unique enough, expanded them.
Diffstat (limited to 'po/update_po.py')
-rwxr-xr-x | po/update_po.py | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/po/update_po.py b/po/update_po.py index 50459c2b14b..88547760f67 100755 --- a/po/update_po.py +++ b/po/update_po.py @@ -1,17 +1,52 @@ -#!/usr/bin/python +#!/usr/bin/env python + +# $Id: +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ***** END GPL LICENSE BLOCK ***** + +# <pep8 compliant> # update all po files in the LANGS +import subprocess import os -PO_DIR = "." +CURRENT_DIR = os.path.dirname(__file__) DOMAIN = "blender" -for po in os.listdir( PO_DIR ): - if po.endswith(".po"): - lang = po[:-3] - # update po file - cmd = "msgmerge --update --lang=%s %s.po %s.pot" % (lang, lang, DOMAIN) - print(cmd) - os.system( cmd ) - + +def main(): + for po in os.listdir(CURRENT_DIR): + if po.endswith(".po"): + lang = po[:-3] + + # update po file + cmd = ("msgmerge", + "--update", + "--lang=%s" % lang, + os.path.join(CURRENT_DIR, "%s.po" % lang), + os.path.join(CURRENT_DIR, "%s.pot" % DOMAIN), + ) + + print(" ".join(cmd)) + process = subprocess.Popen(cmd) + process.wait() + + +if __name__ == "__main__": + main() |