summaryrefslogtreecommitdiff
path: root/src/ollama_web/i18n
diff options
context:
space:
mode:
Diffstat (limited to 'src/ollama_web/i18n')
-rw-r--r--src/ollama_web/i18n/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ollama_web/i18n/__init__.py b/src/ollama_web/i18n/__init__.py
index 56dd217..6ab540c 100644
--- a/src/ollama_web/i18n/__init__.py
+++ b/src/ollama_web/i18n/__init__.py
@@ -9,7 +9,7 @@ from __future__ import annotations
import json
from pathlib import Path
-from typing import Any
+from typing import Any, cast
from ollama_web.config import settings
@@ -22,7 +22,7 @@ def _load_messages(lang: str) -> dict[str, Any]:
path = _MESSAGES_DIR / f"{lang}.json"
try:
with path.open("r", encoding="utf-8") as f:
- return json.load(f)
+ return cast(dict[str, Any], json.load(f))
except (FileNotFoundError, json.JSONDecodeError):
return {}
@@ -81,4 +81,4 @@ def t(key: str, lang: str | None = None, fallback: str | None = None) -> str:
value = _resolve(key, get_messages(resolve_language(lang)))
if isinstance(value, str):
return value
- return fallback if fallback is not None else key
+ return fallback if fallback is not None else key \ No newline at end of file