Other / Validation / Check Language on This Page W3C
The Check Language bookmarklet displays the page's declared language using W3C methodology. Extracts the lang or xml:lang attribute from the html element, uses Intl.DisplayNames to convert the language code to a human-readable language name (e.g., "en" → "English"), displays a centered modal panel showing the detected language, or warns if no language is specified, and includes a link to W3C's "Checking Page Language" guidance. Close with X or dismiss link.
WCAG SC 3.1.1: Language of Page
Run Check Language on This Page W3C
Test run or drag to
bookmarklets bar to install
javascript:%21function()%7Bdocument.querySelectorAll(%22%23wai-styles%2C%23wai-info-box%22).forEach(e%3D%3E%7Be.remove()%7D)%2Cdocument.querySelector(%22body%22).insertAdjacentHTML(%22afterbegin%22%2C%22%3Cstyle%20id%3D%27wai-styles%27%3E%23wai-info-box%7Bposition%3Afixed%3Bwidth%3A40%25%3Btop%3A40%25%3Bleft%3A50%25%3Btransform%3Atranslate(-50%25%2C-50%25)%3Bz-index%3A1000%3Bcolor%3Ablack%3Bfont-family%3ANoto%20Sans%2CTrebuchet%20MS%2CHelvetica%20Neue%2CArial%2Csans-serif%7D%23wai-info-box%7Bborder%3Asolid%201px%20%23ddd%3Bbackground-color%3A%23fff%3Bbox-shadow%3A0%204px%208px%200%20rgba(0%2C0%2C0%2C0.2)%2C0%206px%2020px%200%20rgba(0%2C0%2C0%2C0.19)%3B%7D%23wai-info-box%20header%7Bfont-weight%3A700%3Bbackground-color%3A%23f2f2f2%3Bcolor%3A%23005a6a%3Bpadding%3A8px%2016px%3B%7D%23wai-info-box%20header%20a%7Bfloat%3Aright%3Btext-decoration%3Anone%7D%23wai-info-box%20div%7Bpadding%3A8px%2016px%3B%7D%23wai-info-box%20div%20span%7Bfont-weight%3A700%3B%7D%3C%2Fstyle%3E%22)%3Blet%20e%3Dnavigator.language%7C%7Cnavigator.userLanguage%2Ca%3Dnew%20Intl.DisplayNames(%5Be%5D%2C%7Btype%3A%22language%22%7D)%3Bvar%20o%3D%22%22%3Blet%20t%3Ddocument.documentElement.lang%7C%7Cdocument.getElementsByTagName(%22html%22)%5B0%5D.getAttribute(%22xml%3Alang%22)%3Bo%2B%3Dt%3F%22%3Cspan%3E%22%2Bt%2B%22%20(%22%2Ba.of(t)%2B%22)%3C%2Fspan%3E%22%3A%22Page%20language%20is%20not%20specified%22%2Cdocument.querySelector(%22body%22).insertAdjacentHTML(%22beforeend%22%2C%22%3Caside%20id%3D%27wai-info-box%27%20tabindex%3D%27-1%27%3E%3Cheader%3EPage%20Language%3Ca%20href%3Djavascript%3Adocument.querySelectorAll(%27%23wai-styles%2C%23wai-info-box%27).forEach(function(el)%7Bel.remove()%7D)%3B%20aria-label%3Ddismiss%3EX%3C%2Fa%3E%3C%2Fheader%3E%3Cdiv%3E%22%2Bo%2B%22%3Cp%3EFind%20out%20more%20about%20%3Ca%20href%3D%27https%3A%2F%2Fwww.w3.org%2Fwai%2Ftest-evaluate%2Feasy-checks%2Flanguage%2F%27%3EChecking%20Page%20Language%3C%2Fa%3E%3C%2Fdiv%3E%3C%2Faside%3E%22)%2Cdocument.getElementById(%22wai-info-box%22).focus()%7D()%2Cconsole.log(%22%5CnSource%3A%20https%3A%2F%2Fwww.w3.org%2FWAI%2Ftest-evaluate%2Feasy-checks%2Flanguage%2F%5CnBookmarklet%20name%3A%20Check%20language%20on%20this%20page%5Cn%22)%3B
← Back to all bookmarklets