[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40400] trunk/blender/source/blender/ python/generic/blf_py_api.c: have blf. gettext even when internationalization is disabled (just passes through).
Campbell Barton
ideasman42 at gmail.com
Tue Sep 20 17:11:17 CEST 2011
Revision: 40400
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40400
Author: campbellbarton
Date: 2011-09-20 15:11:17 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
have blf.gettext even when internationalization is disabled (just passes through).
Modified Paths:
--------------
trunk/blender/source/blender/python/generic/blf_py_api.c
Modified: trunk/blender/source/blender/python/generic/blf_py_api.c
===================================================================
--- trunk/blender/source/blender/python/generic/blf_py_api.c 2011-09-20 14:49:12 UTC (rev 40399)
+++ trunk/blender/source/blender/python/generic/blf_py_api.c 2011-09-20 15:11:17 UTC (rev 40400)
@@ -371,7 +371,6 @@
return PyLong_FromLong(BLF_load(filename));
}
-#ifdef INTERNATIONAL
PyDoc_STRVAR(py_blf_gettext_doc,
".. function:: gettext(msgid)\n"
"\n"
@@ -384,6 +383,7 @@
);
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 @@
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 @@
{"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}
};
More information about the Bf-blender-cvs
mailing list