cliLanguage関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The language the command line speaks: --lang, or the environment's, or the system's; Japanese for ja…, English for anything else.
インポート
import { cliLanguage } from "@johnmorrisdotca/tane";
定義
function cliLanguage(flag: string | undefined, env?: Record<string, string | undefined>, locale?: string): Language
引数
| 名前 | 型 | 説明 |
|---|---|---|
flag | string | undefined | An explicit CLI language flag, when supplied. |
env (省略可) | Record<string, string | undefined> | Environment variables used to choose the CLI language. |
locale (省略可) | string | undefined | The host locale used when no explicit language is supplied. |
戻り値
Language
The language the command line speaks: --lang, or the environment's, or the system's; Japanese for ja…, English for anything else.
例
import { cliLanguage } from "@johnmorrisdotca/tane";
console.log(cliLanguage(undefined, { LANG: "ja_JP.UTF-8" }));ja出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。