Marking translatable strings

Skip Montanaro skip at mojam.com
Sun Oct 10 02:18:13 EDT 1999


    Florian> T('...') could mean anything, not only string translation.
    Florian> Perhaps something entirely new should be chosen to help
    Florian> automatic processing.

I agree.  I think the t"""ranslatable string""" notation would work well.
It's simple, the machinery for parsing it is pretty much already there, what
with raw strings and all.  Visually, it's pretty unobtrusive.  There is no
conflict with existing syntax like the T() notation.  It could be handled at
any phase between editing and run-time.  A special preprocessor (if you
wanted translation separate from byte code generation or run-time) could do
whatever translation was possible there.  Any untranslated strings could be
passed through.  Similarly, at byte-compilation time a translate step could
be invoked if need be.  Finally, if any translatable strings were left at
run-time (they've have to be specially marked by the byte compiler of
course), they could be translated then (or passed through as-is if this
final translation step failed).

Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
847-971-7098   | Python: Programming the way Guido indented...





More information about the Python-list mailing list