Multi-sentence batch translation silently returns some sentences untranslated (no error)
Describe the bug
When translating multi-sentence text (English → Arabic) in a single /translate request, some sentences come back completely untranslated (original English), while others in the same request translate correctly. No error is returned by the API, and nothing appears in the container logs.
To Reproduce
Instance: self-hosted, libretranslate/libretranslate:v1.9.6 (Docker), LT_LOAD_ONLY=en,ar,tr.
Send this as a single request to /translate (source=en, target=ar, format=text):
1. `source` was left as `auto` or wrong in whatever client/app you tested from, and it detected mixed input as a language it doesn't have a model for, so it fell through untranslated in parts
2. The client split your text into multiple segments and sent some with a different target
3. You tested via a UI/integration (not raw API) that has its own language-detection step before hitting LibreTranslateResult: line 2 translates to Arabic correctly. Lines 1 and 3 come back as the original English text, unchanged.
Each line translates correctly when sent alone as its own single-sentence request. It only fails when combined with other sentences in one batch request — and which lines fail is inconsistent between runs on the same input.
Expected behavior
All sentences in the request should be translated, or the API should surface an error for any sentence it fails to translate instead of silently returning the source text.
Environment
- LibreTranslate version: 1.9.6 (Docker image
libretranslate/libretranslate:v1.9.6) - Loaded languages: en, ar, tr (
LT_LOAD_ONLY) - Deployment: Docker Compose, self-hosted
- Tested against both
source: en(explicit) andsource: auto— same result either way
Source: LibreTranslate/LibreTranslate