()
Reloads languages
Reloads languages
Reloads languages
def reload():
    """
    Reloads languages
    """
    global NAMES
    NAMES = {}

    for lang in pycountry.languages:
        is_iso6391 = getattr(lang, "alpha_2", None)
        if is_iso6391 or lang.alpha_3 in settings.NON_ISO6391_LANGUAGES:
            NAMES[lang.alpha_3] = NAME_OVERRIDES.get(lang.alpha_3, lang.name)

    # sort by name
    NAMES = OrderedDict(sorted(NAMES.items(), key=lambda n: n[1]))
def reload ( ) : global NAMES NAMES = { } for lang in pycountry . languages : is_iso6391 = getattr ( lang , "alpha_2" , None ) if is_iso6391 or lang . alpha_3 in settings . NON_ISO6391_LANGUAGES : NAMES [ lang . alpha_3 ] = NAME_OVERRIDES . get ( lang . alpha_3 , lang . name ) # sort by name NAMES = OrderedDict ( sorted ( NAMES . items ( ) , key = lambda n : n [ 1 ] ) )