mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-06-25 16:01:08 +03:00
i18n fixes
This commit is contained in:
@@ -188,17 +188,18 @@ def _apply_ui_language(cfg: dict) -> None:
|
||||
|
||||
def load_config() -> dict:
|
||||
ensure_dirs()
|
||||
cfg: Optional[dict] = None
|
||||
if CONFIG_FILE.exists():
|
||||
try:
|
||||
with open(CONFIG_FILE, "r", encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
for k, v in DEFAULT_CONFIG.items():
|
||||
data.setdefault(k, v)
|
||||
_apply_ui_language(data)
|
||||
return data
|
||||
cfg = data
|
||||
except Exception as exc:
|
||||
log.warning("Failed to load config: %s", repr(exc))
|
||||
cfg = dict(DEFAULT_CONFIG)
|
||||
if cfg is None:
|
||||
cfg = dict(DEFAULT_CONFIG)
|
||||
_apply_ui_language(cfg)
|
||||
return cfg
|
||||
|
||||
|
||||
Reference in New Issue
Block a user