def __get_locales(path) -> list: result = [] files = get_paths(path) for name in files: if __validate(files[name]): result.append(name) return result
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)
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)
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
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