v148 · Translator API · on-device
Document Translator
A multi-language document with paragraphs in five languages. Detect, badge, and translate — all on-device via Chrome's Translator API. No keys, no network, no data leaves your machine.
multi-language document
language pair availability
Check which {sourceLanguage, targetLanguage} pairs are available via Translator.availability().
how it works
- Feature-detects
window.Translatorandwindow.LanguageDetector. - "Detect languages" calls
LanguageDetector.create()thendetector.detect(text)on each paragraph. - "Translate all to English" calls
Translator.create({sourceLanguage, targetLanguage:'en'})per non-English paragraph and fires all translations viaPromise.allSettled(). - Language pair availability uses
Translator.availability({sourceLanguage, targetLanguage}). - When the API is absent, a static language-detection simulation is used as fallback.
references
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗