feat: multilingual glossary UI, translate selector, context fusion
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m30s

- TermEditor: rewritten with expandable multilingual translation grid
  (13 languages), editorial styling, source/target + translations JSON
- GlossarySelector: new component in translate page config panel,
  fetches user glossaries, shows flag + term count, Pro+LLM only
- useTranslationConfig: added glossaryId state
- useTranslationSubmit: sends glossary_id to backend
- Context page: removed textarea glossary, presets now create API
  glossaries via template import, added link to Glossaries page
- i18n: added 12 keys × 13 locales for glossary/translate/context

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 15:54:04 +02:00
parent b2d918c832
commit 50d5a8d22f
8 changed files with 563 additions and 129 deletions

View File

@@ -64,6 +64,7 @@ export function useTranslationConfig(hasFile: boolean): UseTranslationConfigRetu
const [sourceLang, setSourceLang] = useState('auto');
const [targetLang, setTargetLang] = useState(settings.defaultTargetLanguage || '');
const [provider, setProvider] = useState<Provider | null>(null);
const [glossaryId, setGlossaryId] = useState<string | null>(null);
const [availableProviders, setAvailableProviders] = useState<AvailableProvider[]>([]);
const [isLoadingProviders, setIsLoadingProviders] = useState(false);
const [languages, setLanguages] = useState<Language[]>([]);
@@ -212,7 +213,8 @@ export function useTranslationConfig(hasFile: boolean): UseTranslationConfigRetu
targetLang,
mode,
provider: provider ?? undefined,
}), [sourceLang, targetLang, mode, provider]);
glossaryId,
}), [sourceLang, targetLang, mode, provider, glossaryId]);
return {
sourceLang,
@@ -229,6 +231,8 @@ export function useTranslationConfig(hasFile: boolean): UseTranslationConfigRetu
setSourceLang,
setTargetLang,
setProvider,
glossaryId,
setGlossaryId,
getConfig,
};
}