Inkscape Wiki

draw freely
Download Now!
Open Source Scalable Vector Graphics Editor
 


Revision as of 18:07, 7 October 2008 by Inductiveload (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

Adding Translation Capability

One can add the ability to have Python text mesages included for translation. To provide an error message, rather than using the Python sys.stderr, use the provided errormsg() function from inkex.py in conjuction with gettext.

You must include the following at the beginning of your Python script:

import inkex
import gettext
_ = gettext.gettext

Where you wish to have an error message, write the following:

inkex.errormsg(_("This will be written to Python stderr"))

Of course, you may also change "_" to something else if you wish.