v161 · concept 1 · basic
Availability states on this device
Translator.availability() is the one call a mobile page can always make cheaply. It never downloads anything and needs no gesture. It's how a page decides whether to show a translate button, offer a download, or hide the feature. Pick a pair and read the raw value your browser returns.
Checking whether
Translator is exposed…probe one pair
No check run yet.
probe what this phone's user reads
A mobile page usually wants to translate its own content (say, English) into the languages in navigator.languages. This table makes one availability() call per language and nothing else.
| Pair | Raw value | What the page should do |
|---|---|---|
| Not checked yet. | ||
LanguageDetector companion: not checked.
reading the four values on a phone
- available: the language pack is on the device.
create()works without a gesture, and translation works offline. - downloadable: Chrome can fetch the pack, but
create()needs a tap (transient user activation) and will use data and storage. On Android, say so before the tap. Chrome also reportsdownloadablefor packs that are installed but that this site hasn't used yet. This is the privacy masking described in the spec (§6.2), so a site can't learn which minority languages you've installed. - downloading: a download is already running, maybe started by another tab. It still needs a gesture to attach.
- unavailable: the pair isn't supported, the identity pair (
en→en) was requested, an iframe isn't allowed thetranslatorfeature, or theTranslatorAPIAllowedpolicy is off. A page can't tell these apart fromavailability()alone.
the code
if (!("Translator" in self)) { /* API not exposed: flag, old Android build, other browser */ }
const state = await Translator.availability({ sourceLanguage: "en", targetLanguage: "hi" });
// Branch on the CURRENT vocabulary. Older pages that test for "readily" or
// "after-download" are reading the 2024 explainer tokens and never match.
see also
- Download on a constrained device: what to do with
downloadable - Failure & policy gates: why
unavailablehappens - Desktop availability matrix (v138)
- ChromeStatus entry (5106126157905920)
- Spec: Translator availability