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
-
Translate
On-device translator. Pairs with Language Detector for full auto-translate.
-
Streaming translation
Use
translateStreaming()to show translated tokens as they arrive — the live-chat case. -
Language pair matrix
Sweep a 12-language source/target grid and colour-code each cell by
availability()state. Available, downloadable, downloading, unavailable. -
Detect + translate pipeline
Three-stage pipeline: input,
LanguageDetector.detect()with confidence, thenTranslator.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: