sugorokuLanguageOffunction
The language an element or its page is in: its own lang, or the nearest above, and English unless that begins with ja.
Import it
import { sugorokuLanguageOf } from "@johnmorrisdotca/sugoroku/play";
Definition
function sugorokuLanguageOf(element: Element | null): SugorokuLanguage
Parameters
| Name | Type | Description |
|---|---|---|
element | Element | null | The host element whose inherited language is read; null selects the fallback. |
Returns
SugorokuLanguage
The language an element or its page is in: its own lang, or the nearest above, and English unless that begins with ja.
Examples
import { sugorokuLanguageOf } from "@johnmorrisdotca/sugoroku/play";
const host = document.createElement("div");
host.lang="ja";
console.log(sugorokuLanguageOf(host));