Reference · Streams, draws and seeds
languageOffunction
The language a tag such as ja-JP or en_US.UTF-8 names: Japanese for anything that starts ja, English otherwise.
Import it
import { languageOf } from "@johnmorrisdotca/tane";
Definition
function languageOf(tag: string | null | undefined): Language
Parameters
| Name | Type | Description |
|---|---|---|
tag | string | null | undefined | The language tag to interpret. |
Returns
Language
The language a tag such as ja-JP or en_US.UTF-8 names: Japanese for anything that starts ja, English otherwise.
Examples
import { languageOf } from "@johnmorrisdotca/tane";
console.log(languageOf("ja-JP"));jaWhat it prints (run when this page was built)