v148 · web api · covered on mdn
Language Detector API
A built-in on-device API for detecting the language of a text string. Uses Gemini Nano (or a similar on-device model) without requiring network access. Available via self.ai.languageDetector.
this feature is documented on MDN
MDN: Translator and Language Detector APIs
MDN covers the full LanguageDetector interface including availability(), create(), detect(), browser compatibility, and usage examples. gendn doesn't duplicate that here.
quick reference
| Entry point | self.ai.languageDetector |
|---|---|
| Availability check | await self.ai.languageDetector.availability() → "available", "downloadable", or "unavailable" |
| Create detector | const detector = await self.ai.languageDetector.create() |
| Detect language | const results = await detector.detect(text) — returns array of { detectedLanguage, confidence } |
| On-device | Yes — uses on-device model; no network requests for inference |
| Shipped in | Chrome 148 (desktop + Android) |
| ChromeStatus | 6494349985841152 — Language Detector API |
| Spec | WICG Language Detection API |