perf+security: fix build, secure downloads, dedupe translations, refactor i18n
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m49s

Frontend:
- Fix Framer Motion / motion-dom build error by pinning framer-motion to
  11.18.2 (compatible with React 19 and Next.js 16).
- Add cross-env and build:local script to bypass standalone symlink errors
  on Windows without Developer Mode.
- Allow NEXT_OUTPUT=default to disable standalone output for local builds.
- Refactor i18n: split 14,177-line src/lib/i18n.tsx into per-locale,
  per-namespace JSON files under src/lib/i18n/messages/.
- Load English synchronously; other locales loaded on demand via dynamic
  imports (reduces initial bundle, improves maintainability).
- Remove unused next-intl message files src/messages/en.json and fr.json.

Backend:
- Remove insecure legacy /api/v1/download/{filename} and /api/v1/cleanup/{filename}
  endpoints. The job-based /api/v1/download/{job_id} already enforces ownership.
- Deduplicate texts in TranslationService.translate_batch before sending them
  to the provider, reducing API calls for repeated strings.
- Pin httpx to <0.28 to fix TestClient incompatibility with starlette 0.35.1.
- Add pytest-cov and ruff dev dependencies/config.

DevOps:
- Remove hardcoded Grafana password from docker-compose.yml and
  docker-compose.monitoring.yml; use GRAFANA_PASSWORD env var.
- Change default TRANSLATION_SERVICE from ollama to google in
  docker-compose.yml (Ollama is an optional profile).
- Add GRAFANA_PASSWORD to .env.example.
- Add .coverage and frontend/pnpm-workspace.yaml to .gitignore.

Tests:
- Update API versioning tests for removed legacy endpoints.
- Add tests/test_translation_service.py for deduplication behavior.

Verified:
- pnpm run build:local passes.
- uv run pytest tests/test_providers/* tests/test_translation_service.py
  tests/test_story_3_5_api_versioning.py tests/test_download_endpoint.py
  tests/test_translators/test_excel_translator.py: provider/translator tests
  pass; one pre-existing French error-message test still fails (message is
  returned in English, unrelated to this change).
This commit is contained in:
2026-06-14 16:44:18 +02:00
parent eda6821632
commit fa637abff0
365 changed files with 23910 additions and 14955 deletions

View File

@@ -0,0 +1,93 @@
{
"translate.glossary.selectGlossary": "Sélectionner un glossaire...",
"translate.mode.label": "Mode de traduction",
"translate.mode.classic": "Classique",
"translate.mode.classicDesc": "Rapide",
"translate.mode.proLlm": "Pro LLM",
"translate.mode.proLlmDesc": "Contextuel",
"translate.mode.tooltip": "Passez à Pro pour la traduction LLM",
"translate.mode.upgradeLink": "Passer à Pro",
"translate.mode.upgradeDesc": "pour des traductions alimentées par LLM",
"translate.glossary.title": "Glossaire",
"translate.glossary.select": "Sélectionner un glossaire",
"translate.glossary.none": "Aucun",
"translate.glossary.terms": "termes",
"translate.glossary.proOnly": "Passez à Pro pour utiliser les glossaires",
"translate.glossary.myGlossaries": "Mes glossaires",
"translate.glossary.fromTemplate": "Créer depuis un template",
"translate.glossary.noGlossaryForPair": "Aucun glossaire pour",
"translate.glossary.noGlossaries": "Aucun glossaire",
"translate.glossary.loading": "Chargement...",
"translate.glossary.classicMode": "Moteur neutre sans glossaire (IA uniquement)",
"translate.glossary.selectPlaceholder": "Sélectionner un glossaire...",
"translate.glossary.multilingual": "MULTILINGUE",
"translate.glossary.noGlossaryAvailable": "Aucun glossaire disponible",
"translate.glossary.filterByLang": "Filtrer par langue",
"translate.glossary.active": "Actif",
"translate.glossary.inactive": "Inactif",
"translate.glossary.availableTemplates": "Modèles disponibles",
"translate.glossary.importing": "Importation...",
"translate.glossary.imported": "(Importé)",
"translate.glossary.noGlossaryForSource": "Aucun glossaire ni modèle pour la langue source",
"translate.glossary.createGlossary": "Créer un glossaire",
"translate.glossary.showAll": "Afficher tous les glossaires",
"translate.glossary.activePreview": "Aperçu des correspondances actives :",
"translate.glossary.total": "au total",
"translate.glossary.moreTerms": "autres termes",
"translate.glossary.noTerms": "Aucun terme dans ce glossaire.",
"translate.glossary.sourceTerm": "Terme Source",
"translate.glossary.translation": "Traduction",
"translate.glossary.addTerm": "Ajouter le terme",
"translate.glossary.disabledMode": "Moteur neutre sans glossaire appliqué",
"translate.glossary.addTermError": "Erreur lors de l'ajout du terme",
"translate.glossary.networkError": "Erreur réseau",
"translate.glossary.importFailed": "Échec de l'importation ({status})",
"translate.glossary.helpText": "Le glossaire force la traduction de termes précis. Choisissez un glossaire dont la langue source correspond à la langue d'origine de votre document.",
"translate.glossary.sourceWarning": "Attention : Ce glossaire utilise la langue source",
"translate.glossary.sourceWarningBut": "mais votre document est configuré en",
"translate.glossary.targetWarning": "Incompatibilité de cible : Ce glossaire est prévu pour traduire vers",
"translate.glossary.targetWarningBut": "mais votre document cible",
"translate.glossary.targetWarningEnd": "Les termes risquent de ne pas être pertinents.",
"translate.header.processing": "Traitement en cours",
"translate.header.aiActive": "Analyse IA active",
"translate.header.aiActiveDesc": "Votre mise en page est en cours de préservation par notre moteur contextuel.",
"translate.header.completed": "Complété",
"translate.header.completedTitle": "Traduction terminée",
"translate.header.proSpace": "Espace Pro",
"translate.header.translateDoc": "Traduire un document",
"translate.header.translateDocDesc": "Conservez la mise en page d'origine grâce au moteur de traduction ultra-haute fidélité.",
"translate.upload.nativeFormat": "Format natif",
"translate.fileType.word": "Word (.docx)",
"translate.fileType.excel": "Excel (.xlsx)",
"translate.fileType.slides": "Slides (.pptx)",
"translate.fileType.pdf": "PDF (.pdf)",
"translate.startTranslation": "Lancer la traduction",
"translate.submit": "Soumission…",
"translate.chooseTargetLang": "Veuillez choisir une langue cible",
"translate.pleaseLoadFile": "Veuillez charger un fichier d'abord",
"translate.contextEngineActive": "Moteur contextuel actif",
"translate.phase1": "Phase 1 : Initialisation",
"translate.phase2": "Phase 2 : Reconstruction contextuelle",
"translate.stat.segments": "segments",
"translate.stat.precision": "précision",
"translate.stat.speedLabel": "vitesse",
"translate.stat.turbo": "Turbo",
"translate.stat.time": "temps",
"translate.complete.masterQuality": "✓ Qualité Maître",
"translate.download": "Télécharger",
"translate.newTranslation": "+ Nouvelle traduction",
"translate.failedTitle": "Erreur lors de la traduction",
"translate.retry": "Réessayer",
"translate.uploadAnother": "Téléverser un autre fichier",
"translate.monitor": "Moniteur IA",
"translate.summary": "Récapitulatif",
"translate.cancelProcess": "⟳ Annuler le processus",
"translate.layoutIntegrity": "Intégrité Layout",
"translate.secureHundred": "100% SÉCURISÉ",
"translate.okHundred": "100% OK",
"translate.preserveLayout": "Conserver la mise en page",
"translate.preserveLayoutDesc": "Conserver la mise en page",
"translate.textOnly": "Texte brut",
"translate.textOnlyDesc": "Traduction rapide du texte uniquement",
"translate.unavailableStandard": "Indisponible en mode Standard (IA uniquement)"
}