Martin Blais wrote: > I'm not sure all the cases are handled, but for those which aren't I > can't see why I couldn't hack the pygettext parser to make it do what > I want, e.g. is the case were the function contains multiple strings > handled? :: > > P(A_("Status: ", get_balance(), "dollars", href=".... ") > > > (No need to answer to list, this is getting slightly OT, I'll check it > out in more detail.)
I'll answer it anyway, because this is important enough for anybody to understand :-) *Never* try to do i18n that way. Don't combine fragments through concatenation. Instead, always use placeholders. IOW, the msgid should be "Status: %s dollars" or, if you have multiple placeholders "Status: %(balance)s placeholders" If you have many fragments, the translator gets the challenge of translating "dollars". Now, this might need to be translated differently in different contexts (and perhaps even depending on the value of balance); the translator must always get the complete message as a single piece. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com