fix: glossary selection respects target language — sort by source+target, reset on lang change, fix template import
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled

- GlossarySelector: filteredGlossaries now sorts matching target_language
  first so FR→FA appears before FR→EN when translating to Persian
- GlossarySelector: toggle auto-select prefers glossary matching
  targetLang, falls back to first available
- useTranslationConfig: reset glossaryId when targetLang changes (was
  only resetting on sourceLang change)
- glossary_routes: set target_language from template data on import
  (was missing, defaulted to None/en)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 22:00:40 +02:00
parent 89c31f8298
commit 5122bfdf99
3 changed files with 15 additions and 5 deletions

View File

@@ -597,6 +597,7 @@ async def import_glossary_template(
user_id=user.id,
name=glossary_name,
source_language=template_data.get("source_lang", "fr"),
target_language=template_data.get("target_lang", "en"),
created_at=datetime.now(timezone.utc),
updated_at=datetime.now(timezone.utc),
)