from zope.component import adapts from zope.publisher.interfaces.browser import IBrowserRequest from zope.publisher.browser import BrowserLanguages from zope.interface import implements class UILanguage(BrowserLanguages): adapts(IBrowserRequest) def getPreferredLanguages(self): #print BrowserLanguages.getPreferredLanguages(self) llang = self.request.get('mdlang', 'et') if llang in ['et', 'en']: return [llang] return [llang]