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?
This commit is contained in:
2013-01-22 14:55:34 +00:00
parent 59b096ed00
commit 63edcf785e
2 changed files with 9 additions and 2 deletions

View File

@@ -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,