[Zope3-dev] Zope 2.9 and Zope 3 i18n, more questions...

Chris Withers chris at simplistix.co.uk
Thu Jun 1 03:33:04 EDT 2006


Hi All,

I had some i18n questions:
http://mail.zope.org/pipermail/zope3-users/2006-May/003529.html

Rocky Burt was good enough to point me at Philipp's excellent article:
http://worldcookery.com/files/fivei18n/

Which has left me with some different questions:

I need to write a language extractor thats returns the language 
specified in an attribute of the currently logged in user or defaults to 
the normal browser extraction. Has anyone done this before? If not, any 
pointers?

I used the following to translate some code inside python scripts:

from Products.PageTemplates.GlobalTranslationService import \
       getGlobalTranslationService
ts = getGlobalTranslationService()
ts.translate(domain,
              msgid,
              context=self,
              target_language=target_language,
              default=default)

What's the equivalent in Z3 land or should I be looking to turn all 
calls to the above into MessageID's? If I do, when and how do they get 
translated?

I've made calls to the following too:

name = ts.getLanguageName('en',self) #'en' is just an example

current = ts.negotiate_language(self,domain) or default

languages = [{'code':code,
              'name':ts.getLanguageName(code, self),
              'selected':current==code} for code in
              ts.getLanguages(self,domain)]

What are the new-world equivalents of these?

Finally, Philipp's article suggests that people may want to write 
message catalog implementations that do the automatic compilation to .mo 
and/or capture and report untranslated message ids. Has anyone done 
this? If not, I might well be up for it :-)

Any help is good help!

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope3-dev mailing list