Ignore:
Timestamp:
Nov 3, 2012, 3:07:43 AM (11 years ago)
Author:
djay
Message:

Add _ method to the zoo Python module to enable translation from zoo-services textdomain. Add gettextPath in the main section of the main.cfg to set the directory to search for language files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal_python.c

    r368 r376  
    2828
    2929PyMethodDef zooMethods[] = {
     30  {"_", PythonTranslate, METH_VARARGS, "Translate a string using the zoo-services textdomain."},
    3031  {"update_status", PythonUpdateStatus, METH_VARARGS, "Update status percentage of a running process."},
    3132  {NULL, NULL, 0, NULL} /* tempt not the blade, all fear the sentinel */
     
    418419
    419420PyObject*
     421PythonTranslate(PyObject* self, PyObject* args)
     422{
     423  char *str;
     424  if (!PyArg_ParseTuple(args, "s", &str)){
     425#ifdef DEBUG
     426    fprintf(stderr,"Incorrect arguments to update status function");
     427#endif
     428    return NULL;
     429  }
     430  return PyString_FromString(_ss(str));
     431}
     432
     433PyObject*
    420434PythonUpdateStatus(PyObject* self, PyObject* args)
    421435{
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png