Compares two locales to find the level of compatibility

    :param a: First locale
    :param b: Second locale
    :return: 2 full match, 1 lang match, 0 no match

def compare_locales(a, b):
    """
    Compares two locales to find the level of compatibility

    :param a: First locale
    :param b: Second locale
    :return: 2 full match, 1 lang match, 0 no match
    """

    if a is None or b is None:
        if a == b:
            return 2
        else:
            return 0

    a = split_locale(a)
    b = split_locale(b)

    if a == b:
        return 2
    elif a[0] == b[0]:
        return 1
    else:
        return 0