[Zope-Coders] Proposal: put i18n into 2.6

Florent Guillaume fg@nuxeo.com
17 Sep 2002 16:15:24 +0200


On Tue, 2002-09-17 at 13:09, Jim Fulton wrote:
> > http://www.zope.org/Members/efge/PersistentTranslationService
> 
> Great. This will be critical for testing the I18n integration during the
> beta period.
> 
> How is (target) language negotiation done? Does localizer do this?
> Does localizer depend on global-variable hacks to get at the request?

Localizer does the language negotiation. It has several means to
determine the language, one being the parsing of Accept-Language
headers, the other being a LOCALIZER_LANGUAGE cookie. The usual way to
switch languages on the fly in Localizer is to have a small form in your
ZPT that does
  <div tal:content="structure here/Localizer/changeLanguageForm">Lang</div>
which produces a small form to change the cookie.

Yes, Localizer does its own monkey-patch to make the request available
from Globals and then get at it from the language negotiation part of
the code.


However note that Localizer is simply my first backend for message
catalogs, I intend to add other ones to PersistentTranslationService,
for instance a port of the one based on filesystem .po files that
Stephan Richter added to Zope 3.


Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com