demo · v131
Translator API
On-device translation, same model family as the Summarizer and Prompt APIs. Pick source and target languages, paste text, and click translate. The button calls Translator.create() and degrades gracefully if the language pair isn't installed.
flags
Needs Chrome 131+ with the model installed. Enable
chrome://flags/#translation-api then visit chrome://components to trigger the model download.
output
Click translate to run the on-device model.
the api
const t = await Translator.create({ sourceLanguage: "fr", targetLanguage: "en" });
const translated = await t.translate("...");
// Streaming variant:
for await (const chunk of t.translateStreaming(text)) print(chunk);