feat(translate): multi-file queue with dedicated runner tests + context polish
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
Batch upload: dropzone and inputs accept multiple files (cap 10/run, validated + deduped); 2+ files switch the submit to a queue screen — sequential jobs with per-file progress, failure messages through the humanizer, per-file download/review links, staggered download-all, real server-side stop (cancel API) plus between-files abort. The one-file flow is untouched: files.length === 1 takes the exact existing path. Runner: standalone runTranslationJob (submit + poll + abort + cancel) with injectable poll interval; 5 dedicated vitest cases covering completed-with-progress, backend failure, submit HTTP error, mid-flight abort with server cancel, and network-failure cutoff. Context page close review: /dashboard/context is a clean redirect to glossaries (no duplicate); the fake 300ms save delay removed (instant zustand persist); suggestion chips now resolve their prompt bodies through i18n (EN+FR — no more French prompts for English users); the translate config column shows a 'Context guidelines active' chip that links to the editor when a Pro LLM prompt is set. Dead code: legacy file-uploader.tsx (+webllm.ts, its only consumer) and the unused PRESETS/applyPreset/clearContext store block removed (-14KB of glossary strings). Verified: build exit 0, vitest 14/14 (9 prior + 5 runner), eslint 62 errors (vs 64 at HEAD), 0 missing i18n keys.
This commit is contained in:
@@ -29,5 +29,6 @@
|
||||
"fileUploader.reconstructing": "Reconstructing document...",
|
||||
"fileUploader.translatingLocally": "Translating locally with WebLLM...",
|
||||
"fileUploader.error.invalidFormat": "Unsupported format. Accepted: .xlsx, .docx, .pptx, .pdf",
|
||||
"fileUploader.error.tooLarge": "File too large (max 50 MB)"
|
||||
"fileUploader.error.tooLarge": "File too large (max 50 MB)",
|
||||
"fileUploader.error.tooMany": "Queue limited to 10 documents per run."
|
||||
}
|
||||
|
||||
@@ -226,5 +226,11 @@
|
||||
"glossaries.suggestion.numbers": "Numbers",
|
||||
"glossaries.suggestion.placeholders": "Placeholders",
|
||||
"glossaries.suggestion.technical": "Technical terms",
|
||||
"glossaries.suggestion.concise": "Concise style"
|
||||
"glossaries.suggestion.concise": "Concise style",
|
||||
"glossaries.suggestion.formal.value": "Always use a formal, professional tone in your translations.",
|
||||
"glossaries.suggestion.proprietary.value": "Do not translate proper nouns, brand names, or people's names.",
|
||||
"glossaries.suggestion.numbers.value": "Keep all figures, percentages, and amounts exactly as written.",
|
||||
"glossaries.suggestion.placeholders.value": "Do not translate variables in braces such as {name}, {date}, {amount}.",
|
||||
"glossaries.suggestion.technical.value": "Keep technical terms in the source language; do not translate them.",
|
||||
"glossaries.suggestion.concise.value": "Prefer short, direct phrasing. Avoid circumlocutions."
|
||||
}
|
||||
|
||||
@@ -101,5 +101,12 @@
|
||||
"translate.cancelledTitle": "Translation cancelled",
|
||||
"translate.cancelledDesc": "The job was stopped and the reserved document slot released.",
|
||||
"translate.cancelFailedTitle": "Could not cancel",
|
||||
"translate.cancelFailedDesc": "The job may have already finished. The display will update shortly."
|
||||
"translate.cancelFailedDesc": "The job may have already finished. The display will update shortly.",
|
||||
"translate.contextActive": "Context guidelines active",
|
||||
"translate.startBatch": "Translate {count} documents",
|
||||
"translate.batch.runningTitle": "Translating your documents",
|
||||
"translate.batch.doneTitle": "{done}/{total} translated",
|
||||
"translate.batch.stop": "Stop the queue",
|
||||
"translate.batch.downloadAll": "Download all",
|
||||
"translate.batch.newSession": "New session"
|
||||
}
|
||||
|
||||
@@ -29,5 +29,6 @@
|
||||
"fileUploader.reconstructing": "Reconstruction du document…",
|
||||
"fileUploader.translatingLocally": "Traduction locale avec WebLLM…",
|
||||
"fileUploader.error.invalidFormat": "Format non supporté. Formats acceptés : .xlsx, .docx, .pptx, .pdf",
|
||||
"fileUploader.error.tooLarge": "Fichier trop volumineux (max 50 Mo)"
|
||||
"fileUploader.error.tooLarge": "Fichier trop volumineux (max 50 Mo)",
|
||||
"fileUploader.error.tooMany": "File limitée à 10 documents par exécution."
|
||||
}
|
||||
|
||||
@@ -226,5 +226,11 @@
|
||||
"glossaries.suggestion.numbers": "Chiffres",
|
||||
"glossaries.suggestion.placeholders": "Placeholders",
|
||||
"glossaries.suggestion.technical": "Termes techniques",
|
||||
"glossaries.suggestion.concise": "Style concis"
|
||||
"glossaries.suggestion.concise": "Style concis",
|
||||
"glossaries.suggestion.formal.value": "Utilise toujours un ton formel et professionnel dans tes traductions.",
|
||||
"glossaries.suggestion.proprietary.value": "Ne traduis pas les noms propres, marques et noms de personnes.",
|
||||
"glossaries.suggestion.numbers.value": "Garde tous les chiffres, pourcentages et montants tels quels sans les modifier.",
|
||||
"glossaries.suggestion.placeholders.value": "Ne traduis pas les variables entre accolades comme {nom}, {date}, {montant}.",
|
||||
"glossaries.suggestion.technical.value": "Conserve les termes techniques en langue originale et ne les traduis pas.",
|
||||
"glossaries.suggestion.concise.value": "Préfère des formulations courtes et directes. Évite les périphrases."
|
||||
}
|
||||
|
||||
@@ -101,5 +101,12 @@
|
||||
"translate.cancelledTitle": "Traduction annulée",
|
||||
"translate.cancelledDesc": "Le job a été arrêté et le document réservé a été libéré.",
|
||||
"translate.cancelFailedTitle": "Annulation impossible",
|
||||
"translate.cancelFailedDesc": "Le job est peut-être déjà terminé. L'affichage se mettra à jour sous peu."
|
||||
"translate.cancelFailedDesc": "Le job est peut-être déjà terminé. L'affichage se mettra à jour sous peu.",
|
||||
"translate.contextActive": "Consignes de contexte actives",
|
||||
"translate.startBatch": "Traduire {count} documents",
|
||||
"translate.batch.runningTitle": "Traduction de vos documents",
|
||||
"translate.batch.doneTitle": "{done}/{total} traduits",
|
||||
"translate.batch.stop": "Arrêter la file",
|
||||
"translate.batch.downloadAll": "Tout télécharger",
|
||||
"translate.batch.newSession": "Nouvelle session"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user