Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20437/python
Modified Files:
global.cpp
Log Message:
- Human_Stablemaster inherits from Human_vendors now
- Added wolfpack.tr to public Python API
- Some additional user visible strings from the core are tr()'ed
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.161
retrieving revision 1.162
diff -C2 -d -r1.161 -r1.162
*** global.cpp 21 Sep 2004 05:28:05 -0000 1.161
--- global.cpp 25 Sep 2004 22:57:10 -0000 1.162
***************
*** 1794,1797 ****
--- 1794,1814 ----
}
+ /*
+ \function wolfpack.tr
+ \param message The message to be translated.
+ \return The translated message into the current server's language.
+ \description Get a message in English and translates it into the current server's language.
+ */
+ static PyObject* wpTr(PyObject*, PyObject *args)
+ {
+ char* message = 0;
+ if ( !PyArg_ParseTuple( args, "s:wolfpack.tr(message)", &message ) )
+ {
+ return 0;
+ }
+ return QString2Python( qApp->translate( "@pythonscript", message ) );
+ }
+
+
static PyMethodDef wpGlobal[] =
{
***************
*** 1853,1856 ****
--- 1870,1874 ----
{ "charcount", wpCharCount, METH_NOARGS, "Returns the number of chars in the world" },
{ "itemcount", wpItemCount, METH_NOARGS, "Returns the number of items in the world" },
+ { "tr", wpTr, METH_VARARGS, NULL },
{ NULL, NULL, 0, NULL } // Terminator
|