- Add template_id column to Glossary model (nullable, indexed)
- Backend: return 409 Conflict if user already imported a template
- Frontend: disable preset cards already imported, show 'Imported' badge
- Fix duplicated text in GlossarySelector source warning (hardcoded FR text removed)
- Complete i18n migration for glossaries page and GlossarySelector
- Add glossaries.presets.alreadyImported key in all 13 locales
47 new i18n keys added across all 13 locales (en, fr, es, de, pt, it,
nl, ru, ja, ko, zh, ar, fa). English and French are fully translated,
remaining locales use French as placeholder.
Files migrated:
- EditGlossaryDialog.tsx (18 strings)
- DeleteGlossaryDialog.tsx (7 strings)
- ProUpgradePrompt.tsx (10 strings)
- WebhookSnippet.tsx (4 strings)
- TranslationModeToggle.tsx (8 strings)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When the user changes the target language dropdown in the edit dialog,
terms now remap to show the language-specific translation from the
translations dict. E.g. changing to Spanish shows 'servidor' instead
of 'server'. Falls back to default English if no translation exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Users can now change the language pair when editing a glossary:
- EditGlossaryDialog has source/target language dropdowns
- Default target_language changed from 'en' to 'multi' in create dialog
- onSave passes source_language and target_language to the backend
- Backend PATCH endpoint already supports updating these fields
Also fixes:
- CreateGlossaryDialog defaults to 'multi' instead of 'en'
- SUPPORTED_LANGUAGES now includes 'multi' option for target
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
Two issues found in screenshot review:
1. Glossary preview always showed English 'target' field (foie → liver)
instead of the language-specific translation. Now looks up
term.translations[targetLang] first, falls back to term.target.
When target is Persian, preview shows 'foie → کبد' (Persian).
2. Previous migration b7c8d9e0f1a2 was already applied on server before
the rename was added. New migration c8d9e0f1a2b3 handles the rename
separately: glossaries with target_language='multi' get their name
changed from 'Anglais' to 'Multilingue'.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Full audit found 18 issues across backend, frontend, and data files.
Root cause: target_language had no single source of truth — 'en' was
hardcoded as default in 6+ places while templates are actually multilingual.
Fixes applied:
- routes/glossary_routes.py: list_glossaries() fallback 'en' → 'multi'
- routes/glossary_routes.py: import reads target_lang from index.json
(source of truth) instead of template file
- data/glossaries/*.json: all 8 template files target_lang 'en' → 'multi'
- services/glossary_service.py: get_glossary_terms() now returns
target_language field (was missing entirely)
- schemas/glossary_schemas.py: all defaults 'en' → 'multi'
(GlossaryCreate, GlossaryResponse, GlossaryListItem)
- useTranslationConfig.ts: only reset glossary on sourceLang change,
not targetLang (multilingual glossaries work with any target)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Templates enriched by enrich_glossary_templates.py already contain
translations for de, es, it, pt, nl, ru, ja, ko, zh, ar, fa (including
Persian). But they were labeled FR→EN, causing incorrect filtering and
warnings when translating to other languages.
Changes:
- index.json: set target_lang='multi' for all 8 templates
- GlossarySelector: treat target_language='multi' as compatible with
any target language (no false warnings, auto-select works)
- GlossarySelector: display '🌐 MULTILINGUE' badge instead of EN flag
- glossary_routes: default target_language to 'multi' instead of 'en'
- Migration: detect existing multilingual glossaries in DB (5+ keys in
translations JSON) and set their target_language to 'multi'
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When activating the glossary toggle, only auto-select a glossary if it
matches BOTH source and target language. If no matching glossary exists
(e.g. translating to Persian but only have FR→EN glossaries), leave the
selector empty so the user picks manually instead of forcing an
incompatible glossary.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 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>
- Create Stripe products/prices (Starter/Pro/Business monthly+yearly)
- Fix CRITICAL bug: add subscription_ends_at + cancel_at_period_end columns to users table
- Alembic migration: f6a7b8c9d0e1_add_subscription_ends_at_cancel_at_period_end
- Fix: implement handle_payment_failed() to set subscription_status=PAST_DUE
- Fix: harmonize .env.production Stripe variable names to match pricing_config.py
- Fix: add missing FRONTEND_URL and STRIPE_PUBLISHABLE_KEY to .env.production
- Add all Stripe Price IDs (test mode) to .env.production
- Wire credit purchase buttons to /api/v1/auth/create-credits-checkout
- Dashboard sync post-checkout was already implemented (no change needed)
Stripe test keys: configured in .env.production
Webhook: must be configured on server via stripe CLI or Stripe Dashboard
Webhook URL: https://wordly.art/api/v1/auth/webhook/stripe
- US1: Replace exposed provider names (DeepSeek V3 → IA Express, MiniMax → IA Avancée)
in legacy_routes.py, remove 52 DeepSeek references from i18n pricing/landing keys,
add generic modelName key across all 13 languages
- US2: Fix glossary selector filtering (fallback to all glossaries when source lang
filter returns empty), show templates by default, fix 3 broken presets
(hvac/construction/automotive → hr/scientific/ecommerce)
- US3: Replace 15 hardcoded French strings with i18n t() calls, increase font sizes
from 8-9px to 11px, improve text contrast (opacity /20→/40, /25→/45, /30→/50)
- US4: Add missing provider labels in admin ProviderStatus (deepseek, minimax, zai,
google_cloud, openrouter, openrouter_premium)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Restructure right sidebar as flex-col with scrollable config and
fixed translate button (never scrolls away)
- Replace expanded GlossarySelector list with compact dropdown (~80px
instead of ~400px), collapsible templates section, click-outside close
- Add visible Classic/IA mode badge after provider selector with hint
about glossary availability for Pro users in classic mode
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The backend expects template_id as a Query parameter, but the frontend
was sending it as a JSON body — causing validation error on every click.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Round check icon on selected glossary (unmissable)
- Error banner when import fails (no more silent spinner)
- Click template that already exists = select it (no re-import)
- Single fetch for glossaries + templates (faster load)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Enriched 8 glossary templates with 18,191 translations across 11 languages
using LLM batch generation + back-translation validation (99.98% confirmed)
- Rewrote GlossarySelector as inline section with template creation
- Fixed sidebar duplicate (single Glossaries link with proOnly flag)
- Added glossaryId reset when sourceLang changes
- Always show GlossarySelector (locked with Pro badge for free users)
- Added source_language flag on glossary cards
- Redirected /dashboard/context to /dashboard/glossaries
- Updated import endpoint to read translations from templates
- Added enrichment script (scripts/enrich_glossary_templates.py)
- Added 6 i18n keys across all 13 locales
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add system prompt textarea and professional presets (HVAC, IT, Legal, etc.) to Glossaries page
- Remove Context from sidebar navigation (constants.ts)
- Make GlossarySelector always visible for Pro users (not just LLM mode)
- Send system prompt from Zustand store to backend via custom_prompt
- Add 24 new i18n keys across all 13 locales for glossaries page
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 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>
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>
The activeTab useState was called after the if(loading) return, violating
React's Rules of Hooks and causing error #310 at runtime.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replaced all references to "Office Translator" with "Wordly" across
i18n translations (13 locales), auth forms, layout components, admin
sidebar, and page metadata.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>