def parse_AcceptLanguage(acceptLanguage):
    """en-US,en;q=0.8,pt;q=0.6"""
    if not acceptLanguage:
        return [('en', '1')]
    languages_with_weigths = acceptLanguage.strip().split(',')
    map(lambda s: s.strip, languages_with_weigths)
    locale_q_pairs = []
    for language in languages_with_weigths:
        try:
            if language.split(';')[0].strip() == language:
                locale_q_pairs.append((language.strip(), '1'))
            else:
                locale = language.split(';')[0].strip()
                q = language.split(';')[1].split('=')[1]
                locale_q_pairs.append((locale, q))
        except IndexError:
            pass
    if locale_q_pairs:
        return sorted(locale_q_pairs, key=lambda v: v[1], reverse=True)
    else:
        return [('en', '1')]
