v148 · AI · demo
Translate Chain
Watch a sentence hop through five languages and back. Each step uses a separate Translator instance — the output of one becomes the input of the next — all on-device.
// Chain: en → fr → ja → de → es → en
const chain = [
{ from: 'en', to: 'fr' },
{ from: 'fr', to: 'ja' },
{ from: 'ja', to: 'de' },
{ from: 'de', to: 'es' },
{ from: 'es', to: 'en' },
];
let text = 'The quick brown fox jumps over the lazy dog.';
for (const { from, to } of chain) {
const t = await Translator.create({
sourceLanguage: from,
targetLanguage: to,
});
text = await t.translate(text);
console.log(`[${from}→${to}]`, text);
}
see also
- Live Translator — real-time translation with language picker
- Back to feature index
- ChromeStatus entry
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗