[Zope3-dev] i18n domains vs. unique message ids -OR- why
Shakespearean English was better
Philipp von Weitershausen
philipp at weitershausen.de
Sat Aug 16 21:05:56 EDT 2003
"I will speak daggers to her, but use None".
-- Hamlet, apparently one of the first i18n-aware python programmers,
in package 3, module 2
When I was browsing the Zope3 UI the other day and had my browser still
set to Spanish, I noticed that the 'View' permission was translated
equally as the 'View' component (both as 'Vista').
While components are nouns (Interface, Content, View, Adapter etc.),
permissions are verbs (Add foobar, Edit foobar, Change foobar, View
foobar etc.). Unfortunately, the English language often happens to be
quite inprecise when it comes to distinguishing nouns from verbs (to
view/the view, to change/the change, to list/the list, etc). Praise the
good old Shakespearean times when English had at least conjugation!
Back to the concrete problem with the translation of Zope: Words like
'View' or 'Change' get translated only either way, as a noun or a verb,
while they could very well appear as both forms. Currently, we have the
problem with 'View': The 'View' permission is defined in ZCML, while
zope/app/services/view.py, line 274 says _("View"), meaning a view
component. The i18n machinery treats them equally.
Zope's i18n machinery provides two possible solutions to this problem
which I call to be discussed on:
1. Have unique message ids for both nouns and verbs like the above. The
noun 'View' would have the message id 'view_component' while the verb
'View' would be 'view_permission'. They could thus be translated
separately and thus differently.
The problem with this solution is that there is no way to manually
specify the message id while still providing a default value with
both zope.i18n.messageid.MessageIDFactory and the ZCML schema field
zope.configuration.fields.MessageID. And the above stated problem
with 'View' just happens to involve these two cases
We would therefore have to provide an English translation to Zope3 as
well, containg at least translation for these kinds of message ids.
2. Use different i18n domains, such as 'zope_permissions',
'zope_components', 'zope_config' etc. One might argue that this is
actually what i18n domains are made for, keeping apart certain
terminology within an application.
The problem with this solution is that
a) we'd have to have more than just ZopeMessageIDFactory which can be
handily imported as _. OTOH, there might only be few modules that
actually would have to use more than one i18n domain.
b) we'd have to do i18ngeddon, meaning going through the source and
changing ZopeMessageIDFactory to something else where appropriate
for python code, setting i18n:domain in ZPTs and i18n_domain in
ZCML.
Thoughts?
Phil
More information about the Zope3-dev
mailing list