Reference · Where every tie sits
localeOffunction
The language an option names: a code of a built-in one, or a Locale.
Import it
import { localeOf } from "@johnmorrisdotca/taisen-brackets/layout";
Also exported from: @johnmorrisdotca/taisen-brackets
Definition
function localeOf(option: string | Locale | undefined): Locale
Parameters
| Name | Type | Description |
|---|---|---|
option | string | Locale | undefined | A code such as |
Returns
Locale
The language; English when the option is empty or the code is not one of the five.
Examples
import { localeOf } from "@johnmorrisdotca/taisen-brackets";
console.log(localeOf("ja").tag, localeOf(undefined).tag);ja enWhat it prints (run when this page was built)