v131 · miscellaneous

Translator API

A JavaScript API to provide language translation capabilities to web pages. Browsers are increasingly offering language translation to their users. Such translation capabilities can also be useful to web developers. This is especially the case when browser's built-in translation abilities cannot help. An enterprise policy (GenAILocalFoundationalModelSettings

concepts

  1. Translate

    On-device translator. Pairs with Language Detector for full auto-translate.

  2. Streaming translation

    Use translateStreaming() to show translated tokens as they arrive — the live-chat case.

  3. Language pair matrix

    Sweep a 12-language source/target grid and colour-code each cell by availability() state. Available, downloadable, downloading, unavailable.

  4. Detect + translate pipeline

    Three-stage pipeline: input, LanguageDetector.detect() with confidence, then Translator.translate() into the user's locale. The canonical comment-thread flow.

why it shipped

Browsers are increasingly offering language translation to their users. Such translation capabilities can also be useful to web developers. This is especially the case when browser's built-in translation abilities cannot help, such as:

references