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

Fred L. Drake, Jr. fred at zope.com
Mon Aug 18 12:36:49 EDT 2003


Philipp von Weitershausen writes:
 > It is an issue nonetheless. The reason why I brought this up instead of 
 > supporting _("message id", "default text"), like you suggested, right 
 > away, was, that Stephan told me he felt strongly about using domains. I 

I'm not sure that using domains for the part-of-speech problem is the
right way to go, but I'm no I18N expert and am willing to bow to the
experience of others.

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")
    ------------------------------------------------

 > 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")
    ------------------------------------------------

 > BTW, the Plone project for example uses distinct message IDs all over 
 > the place. I've found that to be quite a clear approach. Maybe we should 
 > adopt that rule for at least the most common phrases like components and 
 > permissions.

I presume this is still within a single domain, so the ids are things
like "view-permission".  Is that right?

 > We could change extract.py to write the default text into the POT as a 
 > coment. That way we could use explicit message ids even for more 
 > complicated phrases without making it too complicated for the translator.

+1

That would certainly improve life for the translator.


  -Fred

-- 
Fred L. Drake, Jr.  <fred at zope.com>
PythonLabs at Zope Corporation



More information about the Zope3-dev mailing list