Enable the po&pot update system, simply with two python scripts.
authorXiao Xiangquan <xiaoxiangquan@gmail.com>
Wed, 1 Jun 2011 07:57:09 +0000 (07:57 +0000)
committerXiao Xiangquan <xiaoxiangquan@gmail.com>
Wed, 1 Jun 2011 07:57:09 +0000 (07:57 +0000)
po/POTFILES.in [new file with mode: 0755]
po/update-po.py [new file with mode: 0755]
po/update-pot.py [new file with mode: 0755]

diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100755 (executable)
index 0000000..fb0f96c
--- /dev/null
@@ -0,0 +1 @@
+release/scripts/startup/bl_ui/space_info.py
diff --git a/po/update-po.py b/po/update-po.py
new file mode 100755 (executable)
index 0000000..c824b53
--- /dev/null
@@ -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 )
diff --git a/po/update-pot.py b/po/update-pot.py
new file mode 100755 (executable)
index 0000000..4ba918d
--- /dev/null
@@ -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 )