Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Games and state

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/toranpu";

Definition

function cliLanguage(flag: string | undefined, env?: Record<string, string | undefined>, locale?: string): Language

Parameters

NameTypeDescription
flagstring | undefined

An explicit language flag, when supplied.

env (optional)Record<string, string | undefined>

Environment variables used to select 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/toranpu";

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/toranpu 2.15.0.