예제 #1
0
파일: locale_.py 프로젝트: kennym/itools
def get_format(accept):
    # By default use the computer's locale
    if accept is None:
        accept = get_accept()

    # Negotiate
    language = accept.select_language(available_languages)
    if language is None:
        language = 'en'

    # The format
    return formats[language]
예제 #2
0
def get_format(accept):
    # By default use the computer's locale
    if accept is None:
        accept = get_accept()

    # Negotiate
    language = accept.select_language(available_languages)
    if language is None:
        language = 'en'

    # The format
    return formats[language]
예제 #3
0
def get_format(source, accept):
    # By default use the computer's locale
    if accept is None:
        accept = get_accept()

    # Negotiate
    available_languages = source.keys()
    language = accept.select_language(available_languages)
    if language is None:
        language = 'en'

    # The format
    return source[language]