diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c index abf5ee7bada..87e4a301eff 100644 --- a/source/blender/python/generic/blf_py_api.c +++ b/source/blender/python/generic/blf_py_api.c @@ -371,7 +371,6 @@ static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args) return PyLong_FromLong(BLF_load(filename)); } -#ifdef INTERNATIONAL PyDoc_STRVAR(py_blf_gettext_doc, ".. function:: gettext(msgid)\n" "\n" @@ -384,6 +383,7 @@ PyDoc_STRVAR(py_blf_gettext_doc, ); static PyObject *py_blf_gettext(PyObject *UNUSED(self), PyObject *value) { +#ifdef INTERNATIONAL if ((U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE)) { const char *msgid= _PyUnicode_AsString(value); if(msgid == NULL) { @@ -393,11 +393,12 @@ static PyObject *py_blf_gettext(PyObject *UNUSED(self), PyObject *value) return PyUnicode_FromString(BLF_gettext(msgid)); } - else { + else +#endif /* INTERNATIONAL */ + { return Py_INCREF(value), value; } } -#endif /* INTERNATIONAL */ /*----------------------------MODULE INIT-------------------------*/ static PyMethodDef BLF_methods[] = { @@ -414,9 +415,7 @@ static PyMethodDef BLF_methods[] = { {"shadow_offset", (PyCFunction) py_blf_shadow_offset, METH_VARARGS, py_blf_shadow_offset_doc}, {"size", (PyCFunction) py_blf_size, METH_VARARGS, py_blf_size_doc}, {"load", (PyCFunction) py_blf_load, METH_VARARGS, py_blf_load_doc}, -#ifdef INTERNATIONAL {"gettext", (PyCFunction) py_blf_gettext, METH_O, py_blf_gettext_doc}, -#endif {NULL, NULL, 0, NULL} };