fix: glossaries page support for multilingual (target_language='multi')
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m58s

The /dashboard/glossaries page had two issues:
1. SUPPORTED_LANGUAGES had no 'multi' code, so multilingual glossaries
   showed '🌐 undefined' instead of '🌐 Multilingue'
2. The Compatible/Autre cible badge compared target_language directly
   with currentTargetLang, so 'multi' never matched → always showed
   'Autre cible'. Now 'multi' is treated as compatible with any target.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 23:48:48 +02:00
parent e9ac30ed1d
commit 9ab166c31e
2 changed files with 4 additions and 2 deletions

View File

@@ -493,9 +493,10 @@ export default function GlossariesPage() {
const termCount = glossary.terms_count ?? 0;
const srcInfo = SUPPORTED_LANGUAGES.find(l => l.code === glossary.source_language);
const tgtInfo = SUPPORTED_LANGUAGES.find(l => l.code === glossary.target_language);
const isMultilingual = glossary.target_language === 'multi';
// Does this glossary match the current translation target?
const matchesTarget = currentTargetLang && glossary.target_language === currentTargetLang;
const mismatch = currentTargetLang && glossary.target_language && glossary.target_language !== currentTargetLang;
const matchesTarget = currentTargetLang && (isMultilingual || glossary.target_language === currentTargetLang);
const mismatch = currentTargetLang && !isMultilingual && glossary.target_language && glossary.target_language !== currentTargetLang;
return (
<div
key={glossary.id}

View File

@@ -77,6 +77,7 @@ export interface GlossaryUpdateInput {
export const MAX_TERMS_PER_GLOSSARY = 500;
export const SUPPORTED_LANGUAGES: { code: string; label: string; flag: string }[] = [
{ code: 'multi', label: 'Multilingue', flag: '🌐' },
{ code: 'en', label: 'English', flag: '🇬🇧' },
{ code: 'fr', label: 'Français', flag: '🇫🇷' },
{ code: 'es', label: 'Español', flag: '🇪🇸' },