Reference · Streams, draws and seeds
cliLanguagefunction
The language the command line speaks: --lang, or the environment's, or the system's; Japanese for ja…, English for anything else.
Import it
import { cliLanguage } from "@johnmorrisdotca/tane";
Definition
function cliLanguage(flag: string | undefined, env?: Record<string, string | undefined>, locale?: string): Language
Parameters
| Name | Type | Description |
|---|---|---|
flag | string | undefined | An explicit CLI language flag, when supplied. |
env (optional) | Record<string, string | undefined> | Environment variables used to choose the CLI language. |
locale (optional) | string | undefined | The host locale used when no explicit language is supplied. |
Returns
Language
The language the command line speaks: --lang, or the environment's, or the system's; Japanese for ja…, English for anything else.
Examples
import { cliLanguage } from "@johnmorrisdotca/tane";
console.log(cliLanguage(undefined, { LANG: "ja_JP.UTF-8" }));jaWhat it prints (run when this page was built)