翻訳言語定義を YAML に移行しロード処理を実装

- 言語マッピングを src-python/models/translation/languages/languages.yml として追加
- translation_languages.py を全面リファクタ:YAML から読み込み、構造検証、スレッドロック、キャッシュ対応を導入
- config.py に loadTranslationLanguages のインポート/フォールバックを追加し、Config 初期化時に言語定義を読み込むよう変更
- PyYAML を requirements.txt / requirements_cuda.txt に追記
- PyInstaller spec (backend.spec / backend_cuda.spec) に言語ファイル配布先を追加
- translation_ollama.py の loadPromptConfig 呼び出しを修正(ファイル名を明示)
This commit is contained in:
misyaguziya
2025-10-18 23:16:22 +09:00
parent 7e7b3505a1
commit 6596743b6b
8 changed files with 903 additions and 694 deletions

View File

@@ -42,7 +42,7 @@ class OllamaClient:
self.model = None
self.base_url = "http://localhost:11434"
prompt_config = loadPromptConfig(root_path)
prompt_config = loadPromptConfig(root_path, "translation_ollama.yml")
self.supported_languages = prompt_config["supported_languages"]
self.prompt_template = prompt_config["system_prompt"]