Пример #1
0
    def best_match_language(self):
        """Determines best available locale from the Accept-Language header.

        :returns: the best language match or None if the 'Accept-Language'
                  header was not available in the request.
        """
        if not self.accept_language:
            return None
        all_languages = gettextutils.get_available_languages('neutron')
        return self.accept_language.best_match(all_languages)
Пример #2
0
    def best_match_language(self):
        """Determines best available locale from the Accept-Language header.

        :returns: the best language match or None if the 'Accept-Language'
                  header was not available in the request.
        """
        if not self.accept_language:
            return None
        all_languages = gettextutils.get_available_languages('neutron')
        return self.accept_language.best_match(all_languages)
Пример #3
0
 def best_match_language(self):
     """Determine language for returned response."""
     all_languages = gettextutils.get_available_languages('neutron')
     return self.accept_language.best_match(all_languages,
                                            default_match='en_US')
Пример #4
0
 def best_match_language(self):
     """Determine language for returned response."""
     all_languages = gettextutils.get_available_languages('neutron')
     return self.accept_language.best_match(all_languages,
                                            default_match='en_US')