All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m31s
Backend: - Add source_language column to glossaries table - Add translations JSON column to glossary_terms table - Alembic migration for schema changes - format_glossary_for_prompt now language-aware: extracts correct translation per target language, falls back to EN reference for templates with only FR→EN data - CRUD routes accept/return source_language and translations - Pydantic schemas updated Frontend: - Types updated: GlossaryTerm now has translations: Record<string, string> - Glossary/GlossaryListItem now have source_language - Added SUPPORTED_LANGUAGES constant (13 languages) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
36 lines
870 B
Python
36 lines
870 B
Python
"""Add multilingual support to glossaries
|
|
|
|
Revision ID: d4a1f8e2b3c7
|
|
Revises: cb71a958ad92
|
|
Create Date: 2026-05-16
|
|
|
|
Adds source_language to glossaries and translations JSON to glossary_terms.
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
# revision identifiers
|
|
revision = "d4a1f8e2b3c7"
|
|
down_revision = "cb71a958ad92"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"glossaries",
|
|
sa.Column("source_language", sa.String(10), nullable=False, server_default="fr"),
|
|
)
|
|
op.add_column(
|
|
"glossary_terms",
|
|
sa.Column("translations", sa.JSON, nullable=True),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("glossary_terms", "translations")
|
|
op.drop_column("glossaries", "source_language")
|