Esempio n. 1
0
def __get_locales(path) -> list:
    result = []
    files = get_paths(path)
    for name in files:
        if __validate(files[name]):
            result.append(name)
    return result
Esempio n. 2
0
def get_custom_locale(name) -> dict:
    """Get custom locale (for user widgets).

    :param name: str, locale name (file name without ext).
    :return: dict
    """
    conf = RawConfigParser()
    conf.read(get_paths(C_LANGS)[name], 'utf-8')
    return dict(conf)
Esempio n. 3
0
def get_locale(name) -> dict:
    """Get locale.

    :param name: str, locale name (file name without ext).
    :return: dict
    """
    conf = RawConfigParser()
    conf.read(get_paths(LANGS)[name], 'utf-8')
    return dict(conf)
Esempio n. 4
0
def custom_is_exists(name) -> bool:
    """Check exists custom locale (for user widgets).

    :param name: str, locale name (file name without ext).
    :return: bool, True if exists
    """
    files = get_paths(C_LANGS)
    if name in files:
        return __validate(files[name])
    return False
Esempio n. 5
0
def is_exists(name) -> bool:
    """Check exists locale.

    :param name: str, locale name (file name without ext).
    :return: bool, True if exists
    """
    files = get_paths(LANGS)
    if name in files:
        return __validate(files[name])
    return False