Compare commits
2 Commits
dde80f6bc3
...
5e3fb0098b
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e3fb0098b | |||
| a57b8a8e4d |
@@ -49,6 +49,10 @@ except:
|
|||||||
# Run database migrations
|
# Run database migrations
|
||||||
echo "📦 Running database migrations..."
|
echo "📦 Running database migrations..."
|
||||||
alembic upgrade head
|
alembic upgrade head
|
||||||
|
|
||||||
|
# Translate and migrate glossaries to multilingual format
|
||||||
|
echo "🌐 Translating and migrating glossaries to multilingual..."
|
||||||
|
python scripts/migrate_glossaries_to_multilingual_by_translation.py || echo "⚠️ Glossary translation failed but proceeding..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Wait for Redis if configured
|
# Wait for Redis if configured
|
||||||
|
|||||||
@@ -41,9 +41,11 @@ function getDisplaySource(
|
|||||||
glossarySourceLang: string
|
glossarySourceLang: string
|
||||||
): string {
|
): string {
|
||||||
if (!lang || lang === 'multi') return '';
|
if (!lang || lang === 'multi') return '';
|
||||||
if (lang === glossarySourceLang) return term.source;
|
const normalizedLang = lang.toLowerCase();
|
||||||
|
const normalizedSourceLang = glossarySourceLang.toLowerCase();
|
||||||
|
if (normalizedLang === normalizedSourceLang) return term.source;
|
||||||
const translations = term.translations || {};
|
const translations = term.translations || {};
|
||||||
return translations[lang] || '';
|
return translations[normalizedLang] || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Target term in the chosen language.
|
/** Target term in the chosen language.
|
||||||
@@ -54,9 +56,11 @@ function getDisplayTarget(
|
|||||||
glossaryTargetLang: string
|
glossaryTargetLang: string
|
||||||
): string {
|
): string {
|
||||||
if (!lang) return '';
|
if (!lang) return '';
|
||||||
if (lang === 'multi' || lang === glossaryTargetLang) return term.target;
|
const normalizedLang = lang.toLowerCase();
|
||||||
|
const normalizedTargetLang = glossaryTargetLang.toLowerCase();
|
||||||
|
if (normalizedLang === 'multi' || normalizedLang === normalizedTargetLang) return term.target;
|
||||||
const translations = term.translations || {};
|
const translations = term.translations || {};
|
||||||
return translations[lang] || '';
|
return translations[normalizedLang] || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function GlossaryDetailPage() {
|
export default function GlossaryDetailPage() {
|
||||||
|
|||||||
Reference in New Issue
Block a user