[z3-five] Re: Five's translation service, Localizer and PTS

Florent Guillaume fg at nuxeo.com
Wed Jan 25 20:49:40 CET 2006


Hi!

yuppie wrote:
> I'm trying to figure out how this is supposed to work:
> 
> Translated messages normally contain non-ascii characters and are used 
> together with non-ascii content.
> 
> Five's translation service always returns unicode.
> 
> Mixing non-ascii encoded strings with unicode in a page template 
> triggers UnicodeDecodeErrors, so all other strings used in the page 
> template have to be unicode as well.
> 
> How does that work together with Localizer or PTS? Do they return 
> unicode if they are used as fallback translation service?
> 
> Is there a way to get non-unicode translations from Five's translation 
> service?
> 
> What am I missing?

I can answer you about the Localizer side.

Localizer does a monkey patch of the zope 2 pagetemplate engine so that its 
StringIO method (used to build the resulting string in chunks) converts any 
unicode values to the final encoding.

That's the only sane way I could find 3 years ago to deal with mixed 
str/unicode installations.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the z3-five mailing list