[Python-ideas] Gettext syntax (was Re: Allow "assigning" to ...)

Stephen J. Turnbull stephen at xemacs.org
Fri Feb 13 06:05:15 CET 2015


Terry Reedy writes:

 > I18n of existing code would be easier if Tools/i18n had a
 > stringmark.py script that would either mark all strings with _()
 > (or alternative)

This loses badly on your menu example, because you'll end up marking
all the command names.  More generally, I think "mark all" is almost
never going to work as desired in Python because there are so many
places where it's nontrivial to distinguish UI strings needing I18N
from "symbols" (eg, for has_attr() or as internal hash keys), since
Python doesn't have a symbol or bareword type.

 > or interactively let one say yes or no to each.

That's a good idea, although I'd say adding this capability to IDLE
itself would be better yet.  Eg, a command mark-this-string, and a
quick keyboard macro "mark-this-string; 2 * forward-next-string" would
be great in the menu example.



More information about the Python-ideas mailing list