Beispiel #1
0
def babel_localeselector():
    if hasattr(g, 'current_locale'):
        return g.current_locale
    elif request.cookies.get('locale') is not None:
        return request.cookies.get('locale')
    elif current_user is not None:
        return current_user.get_locale()
    return request.accept_languages.best_match(locales.keys())
Beispiel #2
0
def babel_localeselector():
    if hasattr(g, 'current_locale'):
        return g.current_locale
    elif request.cookies.get('locale') is not None:
        return request.cookies.get('locale')
    elif current_user is not None:
        return current_user.get_locale()
    return request.accept_languages.best_match(locales.keys())