[Zope3-Users] RE: translation domains and their scope

Giovannetti, Mark giovanne at nrcan.gc.ca
Thu Feb 22 17:59:40 EST 2007


Hi Philipp,

Thanks for responding.  I am including the mailing list.

> From: Philipp von Weitershausen [mailto:philipp at weitershausen.de] 
> Giovannetti, Mark wrote:
[snip]
> > 
> > However, using http://localhost:8080/ to display the same
> > generic page (as another ISite), the translations do not happen.
> > 
> > I want to use the 'common' translation domain (TD) across more than
> > one site (i.e. the use case above would allow me to have a
> > splash page at the site root using common translations with
> > a choice among subsites).  
> > 
> > So, thinking I should move the 'common' TD to the zope instance
> > root I use the ZMI cut and paste functions to move the 'common'
> > domain from MYSITE to the root/global(?) site.  I also checked,
> > unregistered, and registered where appropriate.
> > 
> > Now the translations for common, formerly functional under
> > MYSITE, no longer work under MYSITE, nor do they work under the
> > root site, nor anywhere else.
> > 
> > What gives?  Is there something bad about using cut and paste 
> > to move a translation domain? 
> > 
> > How are translation domains looked up and used?  What are their
> > scopes?
> 
> The scope of any local utility (and that includes translation 
> domains) is the site that it was registered for. It's therefore 
> not surprising that a translation domain you added and 
> registered in MYSITE are not available outside that folder.

Ok, fair enough.  That still doesn't explain why moving the 'common'
TD to the [top] 'site' (in the ZMI) didn't 'globalize' it.  Oh well, I
guess it's just another of those unexplained head scratchers that
zope3 seems to be infused with.  I was under the impression that
a utility that wasn't found in a local site was searched up-the-stack
to the global site.

> 
> Why aren't you going for global translation domains that are 
> maintained as gettext PO files on the filesystem and registered 
> using ZCML? My book (also the 1st edition) explains how to do that.
> 

I have reread the chapter on i18n and will try the ZCML 
registerTranslations directive.  Does this guarantee that
all translation domains registered via this directive will 
be available *everywhere* in the zope instance?  If so then
I thank you for reminding me about it.  If not, wtf?

I had wanted to use the GUI in the ZMI for simple testing 
before getting to the gettext formalization for the app.
I'd also like to have the possibility of allowing clerical
staff to enter immediate translations for content using
the ZMI GUI but my expectations in this may not be realized.

I will inform the mailing list of my progress. 

Thanks again.

Mark














More information about the Zope3-users mailing list