4 # ***** BEGIN GPL LICENSE BLOCK *****
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # ***** END GPL LICENSE BLOCK *****
24 # update all mo files in the LANGS
30 GETTEXT_MSGFMT_EXECUTABLE = "msgfmt"
31 CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
32 SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, "..")))
33 LOCALE_DIR = os.path.join(SOURCE_DIR, "release", "bin", ".blender", "locale")
39 lang = os.path.basename(po)[:-3]
42 cmd = (GETTEXT_MSGFMT_EXECUTABLE,
44 os.path.join(CURRENT_DIR, "%s.po" % lang),
46 os.path.join(LOCALE_DIR, lang, "LC_MESSAGES", "%s.mo" % DOMAIN),
50 process = subprocess.Popen(cmd)
56 for lang in sys.argv[1:]:
57 po = os.path.join(CURRENT_DIR, lang + '.po')
59 if os.path.exists(po):
62 for po in os.listdir(CURRENT_DIR):
63 if po.endswith(".po"):
66 if __name__ == "__main__":
67 print("\n\n *** Running %r *** \n" % __file__)