Reference · Game engine and table
hitotsuLanguageOffunction
The language a language tag such as "ja", "ja-JP" or "en-GB" asks for: Japanese for any ja, English for everything else, and for nothing.
Import it
import { hitotsuLanguageOf } from "@johnmorrisdotca/hitotsu";
Definition
function hitotsuLanguageOf(tag: string | null | undefined): HitotsuLanguage
Parameters
| Name | Type | Description |
|---|---|---|
tag | string | null | undefined | The language tag to interpret. |
Returns
HitotsuLanguage
The language a language tag such as "ja", "ja-JP" or "en-GB" asks for: Japanese for any ja, English for everything else, and for nothing.
Examples
import { hitotsuLanguageOf } from "@johnmorrisdotca/hitotsu";
console.log(hitotsuLanguageOf("ja-JP"));jaWhat it prints (run when this page was built)