perf+security: fix build, secure downloads, dedupe translations, refactor i18n
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m49s
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:
29
frontend/src/lib/i18n/messages/pt/providerTheme.json
Normal file
29
frontend/src/lib/i18n/messages/pt/providerTheme.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"providerTheme.deepseek.badge": "Essencial",
|
||||
"providerTheme.deepseek.subBadge": "Técnico e económico",
|
||||
"providerTheme.deepseek.desc": "Tradução ultra-precisa e económica, ideal para documentos técnicos e código.",
|
||||
"providerTheme.openai.badge": "Premium",
|
||||
"providerTheme.openai.subBadge": "Alta fidelidade",
|
||||
"providerTheme.openai.desc": "O padrão global de IA. Máxima consistência textual e respeito estrito do estilo.",
|
||||
"providerTheme.minimax.badge": "Avançada",
|
||||
"providerTheme.minimax.subBadge": "Desempenho",
|
||||
"providerTheme.minimax.desc": "Velocidade de execução incrível e excelente compreensão de estruturas complexas.",
|
||||
"providerTheme.openrouter.badge": "Expresso",
|
||||
"providerTheme.openrouter.subBadge": "Multi-modelo",
|
||||
"providerTheme.openrouter.desc": "Acesso unificado aos melhores modelos open-source otimizados para tradução.",
|
||||
"providerTheme.openrouter_premium.badge": "Ultra",
|
||||
"providerTheme.openrouter_premium.subBadge": "Contexto máximo",
|
||||
"providerTheme.openrouter_premium.desc": "Assistido pelos modelos mais avançados (GPT-4o, Claude Sonnet 4.6) para documentos longos.",
|
||||
"providerTheme.zai.badge": "Especializada",
|
||||
"providerTheme.zai.subBadge": "Finanças e Direito",
|
||||
"providerTheme.zai.desc": "Modelo afinado para terminologias empresariais exigentes (jurídico, financeiro).",
|
||||
"providerTheme.default.badge": "Moderno",
|
||||
"providerTheme.default.subBadge": "Raciocínio IA",
|
||||
"providerTheme.default.desc": "Tradução por modelo de linguagem grande (LLM) com análise semântica avançada.",
|
||||
"providerTheme.classic.google.label": "Google Tradutor",
|
||||
"providerTheme.classic.google.desc": "Tradução ultra-rápida cobrindo mais de 130 idiomas. Recomendado para fluxos gerais.",
|
||||
"providerTheme.classic.deepl.label": "DeepL Pro",
|
||||
"providerTheme.classic.deepl.desc": "Tradução de alta precisão conhecida pela sua fluência e formulações naturais.",
|
||||
"providerTheme.classic.google_cloud.label": "Google Cloud API",
|
||||
"providerTheme.classic.google_cloud.desc": "Motor cloud profissional otimizado para processar grandes volumes de documentos."
|
||||
}
|
||||
Reference in New Issue
Block a user