diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-11-23 20:17:12 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-11-23 20:17:12 +0400 |
commit | 39dc956f593b3406bf1d81fb83c557b7b51f5327 (patch) | |
tree | 50b59815aad48902a6563aefc8b944daf34c401e /intern/locale/SConscript | |
parent | 5d5176095e82b34499e15d74f1fb76d56f4d9508 (diff) | |
parent | d846c9a3b75c3d6f20bc7ab7d2da6cdd18bbbef2 (diff) |
Merge branch 'master' into soc-2013-rigid_body_simsoc-2013-rigid_body_sim
Conflicts:
intern/rigidbody/CMakeLists.txt
release/datafiles/splash.png
source/blender/editors/space_view3d/drawobject.c
source/blender/makesdna/DNA_view3d_types.h
Diffstat (limited to 'intern/locale/SConscript')
-rw-r--r-- | intern/locale/SConscript | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/intern/locale/SConscript b/intern/locale/SConscript index f60bd90fb38..4136ac8237d 100644 --- a/intern/locale/SConscript +++ b/intern/locale/SConscript @@ -37,3 +37,56 @@ if env['WITH_BF_INTERNATIONAL']: incs += ' ' + env['BF_BOOST_INC'] env.BlenderLib( 'bf_intern_locale', sources, Split(incs), defs, libtype=['intern','player'], priority=[10, 185]) + +if env['WITH_BF_INTERNATIONAL']: + import os + from os.path import dirname + + def normpath(path): + return os.path.abspath(os.path.normpath(path)) + + # build directory + source_dir = Dir('.').srcnode().path + root_build_dir = normpath(env['BF_BUILDDIR']) + root_source_dir = dirname(dirname(normpath(source_dir))) + po_dir = os.path.join(root_source_dir, "release", "datafiles", "locale", "po") + build_dir = os.path.join(root_build_dir, 'locale') + + if os.path.exists(po_dir): + # create directory if needed + if not os.path.exists(build_dir): + os.makedirs(build_dir) + + msgfmt_tool = env.Clone() + msgfmt_tool.Append(LINKFLAGS = env['PLATFORM_LINKFLAGS']) + + targetpath = root_build_dir + '/msgfmt' + + msgfmt_target = msgfmt_tool.Program(target = targetpath, source = ['msgfmt.cc']) + + locale = env.Clone() + + msgfmt_executable = targetpath + if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw', 'win64-mingw'): + msgfmt_executable += ".exe" + + # dependencies + dependencies = [msgfmt_target] + + # add command for each locale + all_mo_files = [] + for f in os.listdir(po_dir): + if not f.endswith(".po"): + continue + + po_file = os.path.join(po_dir, f) + mo_file = os.path.join(build_dir, os.path.splitext(f)[0] + ".mo") + + command = "\"%s\" \"%s\" \"%s\"" % (msgfmt_executable, po_file, mo_file) + + locale.Command(mo_file, po_file, command) + locale.Depends(mo_file, dependencies) + + all_mo_files.append(mo_file) + + env.Depends("boost_locale_wrapper.cpp", all_mo_files) |