Modifying the Python code

First, ensure that the text to be translated is in a reasonable form for translation.

Enclose each translatable string in a call to the underscore function "_". For example:

_("File not found: %s") % filespec

The _ function will fetch the translation, if available, when the statement containing the string is executed. The following limitations apply:

if not isinstance(filespec, unicode):
   filespec = unicode(filespec, locale.getlocale()[1])
   _("File not found: %s") % filespec

Note: There is a conflict between the definition of the _ function as used by the Python modules (pygettext and gettext) that handle translations, and the automatic assignment of interactively generated expression values to the variable _. In order to resolve this, the translation initialization code in the extension module disables this assignment.

Calls to the spss.StartProcedure function (or the spss.Procedure class) should use the form spss.StartProcedure(procedureName,omsIdentifier) where procedureName is the translatable name associated with output from the procedure and omsIdentifier is the language invariant OMS command identifier associated with the procedure. For example:

spss.StartProcedure(_("Demo"),"demoId")