diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-22 18:55:34 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-22 18:55:34 +0400 |
commit | 63edcf785e2c08a77a248845310a1498fb18e96a (patch) | |
tree | 291e8edb30f6ff511b7d53f1ed548d99d50f8094 | |
parent | 59b096ed00c545a7237db3a4d2768122740d675e (diff) |
Fix for build with scons whithout i18n support.
This should not be needed, I really see no reason for this linking error, but I'd rather use this hack than wasting more time over this issue. When will we get rid of this "two build systems to maintain" time-wasting situation?
-rw-r--r-- | source/blender/blenfont/SConscript | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app_translations.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenfont/SConscript b/source/blender/blenfont/SConscript index d1ef181f75c..3529330a308 100644 --- a/source/blender/blenfont/SConscript +++ b/source/blender/blenfont/SConscript @@ -43,4 +43,4 @@ if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross': if env['WITH_BF_INTERNATIONAL']: defs.append('WITH_INTERNATIONAL') -env.BlenderLib ( 'bf_blenfont', sources, Split(incs), Split(defs), libtype=['core','player'], priority=[210,210] ) +env.BlenderLib ( 'bf_blenfont', sources, Split(incs), defines=defs, libtype=['core','player'], priority=[210,210] ) diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c index 73e2d193aee..13ca90c4e34 100644 --- a/source/blender/python/intern/bpy_app_translations.c +++ b/source/blender/python/intern/bpy_app_translations.c @@ -516,7 +516,10 @@ static PyObject *app_translations_pgettext(BlenderAppTranslations *UNUSED(self), /* Note we could optimize this a bit when WITH_INTERNATIONAL is not defined, but don't think "code complexity" would * be worth it, as this func should not often be used! */ - static const char *kwlist[] = {"msgid", "msgctxt", NULL}; + /* XXX This code fails with scons when WITH_INTERNATIONAL is not defined, at link time, stating that BLF_pgettext + * is undefined... So using #ifdef after all, rather than removing scons from blender trunk! + */ + static const char *kwlist[] = {"msgid", "msgctxt", NULL}; char *msgid, *msgctxt = NULL; if (!PyArg_ParseTupleAndKeywords(args, kw, "s|z:bpy.app.translations.pgettext", (char **)kwlist, @@ -525,7 +528,11 @@ static PyObject *app_translations_pgettext(BlenderAppTranslations *UNUSED(self), return NULL; } +#ifdef WITH_INTERNATIONAL return PyUnicode_FromString(BLF_pgettext(msgctxt ? msgctxt : BLF_I18NCONTEXT_DEFAULT, msgid)); +#else + return PyUnicode_FromString(msgid); +#endif } PyDoc_STRVAR(app_translations_locale_explode_doc, |