Skip to the content

Tane種

Reproduce numbers from a seed, shuffle or pick items, share a daily puzzle and resume a saved stream.

Tane means seed in Japanese. About the name

Contents

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

NameTypeDescription
flagstring | 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" }));
ja

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tane 1.3.0.