'Return a list of preferred languages, most preferred first.
The list may be empty.'

def languages(self):

    if (self._languages is not None):
        return self._languages
    acceptLanguage = self.environ.get('HTTP_ACCEPT_LANGUAGE')
    langs = ACCEPT_LANGUAGE.parse(self.environ)
    fallback = self.defaults.get('language', 'en-us')
    if (not fallback):
        return langs
    if (fallback not in langs):
        langs.append(fallback)
    index = langs.index(fallback)
    langs[(index + 1):] = []
    self._languages = langs
    return self._languages
