Stephan Richter wrote: >> - How do a write/register a negotiator that choose a language based on >> an attribute of the user object and then falls back to normal browser >> negotiation if that attribute isn't present? > > Just implement the right interface and register it. This is not too hard and > I > think there are code examples out there.
There is an example on Philipp's book. I don't have it here, but this for instance FORCES italian all the way: from zope.publisher.browser import BrowserLanguages class BrowserItalianLanguage(BrowserLanguages): def getPreferredLanguages(self): # langs = super(BrowserFormLanguages, self).getPreferredLanguages() return ['it'] and then in overrides.zcml: <adapter for="zope.publisher.interfaces.browser.IBrowserRequest" provides="zope.i18n.interfaces.IUserPreferredLanguages" factory="my.package.BrowserItalianLanguage" /> of course you would normally get 'langs' from the super method and manipulate it before returning _______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users