Built-in AI task APIs · part 1

Language Detector → lang attribute

This page is <html lang="en">, but its comments aren't all in English. Detect each comment's language on-device with Chrome's Language Detector API and set lang on it, so a screen reader reads it with the right voice (WCAG 3.1.2). Nothing leaves your device. Companion demo for the blog post — see README.md.

Controls

Language Detector: checking…

Changing it re-applies the decision to the results you already have; it doesn't run the model again.

Comments

    Once the detector exists, a MutationObserver annotates new comments as they're added.

    Resulting markup

    Read live from the DOM: what assistive technology actually sees.