i18n fixes

This commit is contained in:
Flowseal
2026-06-23 18:24:26 +03:00
parent 85b5e7f22a
commit 6b5fd72612
9 changed files with 38 additions and 19 deletions
+4 -3
View File
@@ -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