From 515f96a7779f117a7e37f854de2ded99160d0c76 Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sun, 2 Aug 2026 15:50:41 +0900 Subject: scrape_url / pdf_to_text / search_and_fetch はページング(継続トークン方式)に対応 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mypy 6エラー修正 --- src/ollama_web/i18n/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ollama_web/i18n/__init__.py') 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 -- cgit v1.2.3