lib/gettor/requests.py
def checkAndGetLocale(self, locale):
        """Look through our aliases list for languages and check if the user
           requested an alias rather than an 'official' language name. If he 
           does, map back to that official name. Also, if the user didn't 
           request a language we support, fall back to default.
        """
        for (lang, aliases) in self.config.SUPP_LANGS.items():
            if lang == locale:
                return locale
            if aliases is not None:
                if locale in aliases:
                    logging.debug("Request for %s via alias %s" % (lang, alias))
                    # Return the 'official' name
                    return lang
        else:
            logging.debug("Requested language %s not supported. Fallback: %s" \
                              % (self.replyLocale, self.config.DEFAULT_LOCALE))
            self.replyLocale = self.config.DEFAULT_LOCALE
            return
Look through our aliases list for languages and check if the user
           requested an alias rather than an 'official' language name. If he 
           does, map back to that official name. Also, if the user didn't 
           request a language we support, fall back to default.
        
Look through our aliases list for languages and check if the user
requested an alias rather than an 'official' language name. If he
does, map back to that official name. Also, if the user didn't
request a language we support, fall back to default.
Look through our aliases list for languages and check if the user requested an alias rather than an ' official ' language name . If he does map back to that official name . Also if the user didn ' t request a language we support fall back to default .
def checkAndGetLocale(self, locale):
        for (lang, aliases) in self.config.SUPP_LANGS.items():
            if lang == locale:
                return locale
            if aliases is not None:
                if locale in aliases:
                    logging.debug("Request for %s via alias %s" % (lang, alias))
                    return lang
        else:
            logging.debug("Requested language %s not supported. Fallback: %s" \
                              % (self.replyLocale, self.config.DEFAULT_LOCALE))
            self.replyLocale = self.config.DEFAULT_LOCALE
            return
def checkAndGetLocale ( self , locale ) : for ( lang , aliases ) in self . config . SUPP_LANGS . items ( ) : if lang == locale : return locale if aliases is not None : if locale in aliases : logging . debug ( "Request for %s via alias %s" % ( lang , alias ) ) return lang else : logging . debug ( "Requested language %s not supported. Fallback: %s" % ( self . replyLocale , self . config . DEFAULT_LOCALE ) ) self . replyLocale = self . config . DEFAULT_LOCALE return
Look through our aliases list for languages and check if the user
requested an alias rather than an 'official' language name.
Look through our aliases list for languages and check if the user requested an alias rather than an ' official ' language name .
"""Look through our aliases list for languages and check if the user
           requested an alias rather than an 'official' language name. If he 
           does, map back to that official name. Also, if the user didn't 
           request a language we support, fall back to default.
        """ # Return the 'official' name
self
locale