Enable the po&pot update system, simply with two python scripts.

This commit is contained in:
Xiao Xiangquan 2011-06-01 07:57:09 +00:00
parent 0fc21dde4e
commit b0cc5b9d4c
3 changed files with 57 additions and 0 deletions

1
po/POTFILES.in Executable file

@ -0,0 +1 @@
release/scripts/startup/bl_ui/space_info.py

42
po/update-po.py Executable file

@ -0,0 +1,42 @@
#!/usr/bin/python
#update all po files in the LANGS
import os
DOMAIN = "blender"
LANGS = (
"ar",
"bg",
"ca",
"cs",
"de",
"el",
"es",
"fi",
"fr",
"hr",
"it",
"ja",
"ko",
"nl",
"pl",
"pt_BR",
"ro",
"ru",
"sr@Latn",
"sr",
"sv",
"uk",
"zh_CN"
)
#-o %s.new.po
for lang in LANGS:
# update po file
cmd = "msgmerge --update --lang=%s %s.po %s.pot" % (lang, lang, DOMAIN)
print(cmd)
os.system( cmd )
# show stats
cmd = "msgfmt --statistics %s.po" % lang
os.system( cmd )

14
po/update-pot.py Executable file

@ -0,0 +1,14 @@
#!/usr/bin/python
#update the pot file according the POTFILES.in
import os
GETTEXT_XGETTEXT_EXECUTABLE="xgettext"
SOURCE_DIR=".."
DOMAIN="blender"
cmd = "%s --files-from=%s/po/POTFILES.in --keyword=_ --keyword=gettext --directory=%s --output=%s/po/%s.pot" % (
GETTEXT_XGETTEXT_EXECUTABLE, SOURCE_DIR, SOURCE_DIR, SOURCE_DIR, DOMAIN)
os.system( cmd )