[Zope3-dev] Re: i18n domains vs. unique message ids -OR- why Shakespearean English was better

Barry Warsaw barry at python.org
Mon Aug 18 18:45:38 EDT 2003


On Mon, 2003-08-18 at 11:36, Fred L. Drake, Jr. wrote:

> I think the part-of-speech problem certainly is easier to deal with if
> _() and the tools are extended for easier use of default text:
> 
>     ------------------------------------------------
>     _("View [as a noun]", "View")
>     _("View [as a verb]", "View")
>     ------------------------------------------------

Wild thought: the extraction tools could grok this and generate the
en/.po file at the same time it's generating the .pot file.  You could
make the source language switchable.

>  > have given that some thought and it appears to me as a very obvious 
>  > solution, yet the extraction tools, for example, will hardly be able to 
>  > figure out what domain we're using in a certain python module.
> 
> Perhaps I don't understand the problem with this:
> 
>     ------------------------------------------------
>     from zope.i18n.messageid import MessageIDFactory
> 
>     _d1 = MessageIDFactory("domain-1")
>     _d2 = MessageIDFactory("domain-2")
>     ------------------------------------------------

If you're using some derivative of pygettext, then this would require
multiple passes over the source, with different switches for the marker
function name.  Not terribly convenient, but not too bad.

-Barry





More information about the Zope3-dev mailing list