[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 14:02:22 EDT 2003
Philipp von Weitershausen writes:
> I personally actually tend to prefer having explicit message ids like
> view_permission, adapter_component etc. wherever possible. The change
> would only affect MessageIDFactory and extract.py. The source code
> itself could be migrated step by step.
That's good for me; I wasn't trying to suggest *not* doing this.
> It would have to be solved for ZCML, though. Where do we specify the
> 'view_permission' message id in the statement::
>
> <permission id="zope.View" title="View" /> ?
>
> Maybe::
>
> <permission id="zope.View" title="[view_permission] View" />
This seems reasonable to me. The only possible issue would be using
the implied message id for something where the default text looks like
that; I'll propose that:
<permission id="zope.View" title="[] [View] more text" />
would use "[View] more text" as both message id and default text.
This is a pretty weird edge case, but the behavior should be clearly
defined.
> Would the tool then be so smart to figure out that
>
> _d1('some text')
>
> means 'some text' needs to be translated in "domain-1"?
No; that's not required. The source file would need to be processed
twice; once for each domain, with _d1 or _d2 being used as the mark
name instead of _; the tools already support this using a command line
option (or so Barry says ;).
-Fred
--
Fred L. Drake, Jr. <fred at zope.com>
PythonLabs at Zope Corporation
More information about the Zope3-dev
mailing list