The previous migration used revision 'a1b2c3d4e5f6' which was already
taken by 005_add_reset_token_to_users.py, causing a cycle. Also both
f6a7b8c9d0e1 and the new migration pointed to the same down_revision.
Fixed:
- New unique revision ID: b7c8d9e0f1a2
- down_revision points to f6a7b8c9d0e1 (current head)
- Chain: e5b2c9d1f4a8 → f6a7b8c9d0e1 → b7c8d9e0f1a2
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>
Google Cloud Translation API was returning "Requests to this API are
blocked" which got wrapped as a misleading "Erreur lors de la lecture
du fichier PowerPoint". Now probes the key once (cached 10min) and
falls back to deep_translator (free) when the Cloud key is invalid.
Co-Authored-By: Claude Opus 4.7 <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>
Two critical fixes:
1. Provider "google" (default classic mode) now checks for a Google Cloud
API key (GOOGLE_CLOUD_API_KEY in env or admin settings). If present,
uses GoogleCloudTranslationProvider (official API). Previously it
always fell through to deep_translator (free scraper) which gets
blocked in production, silently returning untranslated text.
2. Added translation verification: each translator now tracks how many
texts were attempted vs actually changed. If 0 texts were translated,
the job is marked as FAILED with a clear error message instead of
returning the original file as "completed".
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Three fixes to ensure alembic migrations always run in production:
1. entrypoint.sh: add `exec "$@"` passthrough so `docker compose run
--rm backend alembic upgrade head` actually runs alembic instead of
ignoring args and starting uvicorn.
2. entrypoint.sh: remove `|| echo` fallback on alembic — if migration
fails the container must stop, not silently continue.
3. deploy.yml: start only postgres+redis first, run migration, THEN
start backend. Previously the backend started before migration,
ran with stale schema, and the separate migration step was broken
by the entrypoint bug.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
8-step pipeline:
1. Git pull
2. pg_dumpall + gzip backup (keep last 10)
3. Build images (with cache)
4. Start services
5. Wait for postgres
6. Run alembic migration (one-shot container)
- On failure: auto-restore DB from backup
7. Health check backend
- On failure: auto-rollback DB + restart
8. Summary with backup path
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Use 'docker compose run --rm backend alembic upgrade head' to run
migration in a throwaway container (doesn't need backend running)
- Restore entrypoint migration fallback (don't block startup)
- Restart backend after migration to pick up schema changes
- Remove --no-cache (too slow, was causing timeouts)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Entrypoint migration can fail silently. Now runs explicitly:
1. Wait for postgres
2. alembic upgrade head (explicit, fails the deploy if broken)
3. Wait for backend healthy
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>