demo · v131
language pair availability matrix
Not every source/target pair has a model on the device. Translator.availability({sourceLanguage, targetLanguage}) returns the four-state union. This page sweeps a 12-language matrix and renders each cell colour-coded so you can see at a glance which routes are free, which require download, and which are unsupported.
flags
Chrome 131+ with
chrome://flags/#translation-api enabled and the on-device model installed.
available
downloadable
downloading
unavailable
| from \ to |
|---|
why a matrix
The Translator API ships individual language pair models. Translating EN to FR is one download; EN to JA is another. availability() lets a UI decide whether to show a translate button immediately, show a "1.2GB download" CTA, or hide the option entirely. Sweeping the matrix is how product teams choose which pairs to surface.
the api
const pairs = [];
for (const src of LANGS) for (const tgt of LANGS) if (src !== tgt) pairs.push([src, tgt]);
for (const [src, tgt] of pairs) {
const state = await Translator.availability({ sourceLanguage: src, targetLanguage: tgt });
grid.set(src, tgt, state);
}