Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-20 19:11:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-20 19:11:17 +0400
commitf5bb22d088deed703a21145a258c9d28dda9c4da (patch)
treee885952d241d1bb382f45b8cb22ad31beece9d61 /source/blender/python/generic/blf_py_api.c
parent2af7bb8aaff41afffd336d4785713591e6f960eb (diff)
have blf.gettext even when internationalization is disabled (just passes through).
Diffstat (limited to 'source/blender/python/generic/blf_py_api.c')
-rw-r--r--source/blender/python/generic/blf_py_api.c9
1 files changed, 4 insertions, 5 deletions
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}
};