From 63edcf785e2c08a77a248845310a1498fb18e96a Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 22 Jan 2013 14:55:34 +0000 Subject: 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? --- source/blender/blenfont/SConscript | 2 +- 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, -- cgit v1.2.3