Marking translatable strings

Barry A. Warsaw bwarsaw at cnri.reston.va.us
Mon Oct 11 14:12:21 EDT 1999


>>>>> "SM" == Skip Montanaro <skip at mojam.com> writes:

    SM> How do you distinguish between a translatable string and a
    SM> call to a function named "_"?

You don't (or at least I don't in my admittedly sketchy forays so
far).  My pygettext.py uses tokenize to find all the function _()
calls and extracts the string inside them, writing them to the .pot
file.  It's still up to the application to write the _ function (which
probably does a caching lazy run-time translation of the string), and
make it global available.

-Barry




More information about the Python-list mailing list