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
> 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
# langs = super(BrowserFormLanguages, self).getPreferredLanguages()
and then in overrides.zcml:
of course you would normally get 'langs' from the super method and
manipulate it before returning
Zope3-users mailing list