Skip to the content

Korokoroコロコロ

Roll mixed dice or type notation, compare exact probabilities, keep a history and replay seeded rolls.

Korokoro describes something small rolling in Japanese. About the name

Contents

Reference · Rolls and exact odds

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

Definition

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

Parameters

NameTypeDescription
flagstring | undefined

Explicit language flag, when supplied.

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

Environment variables used to choose the language.

locale (optional)string | undefined

Locale to use 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/korokoro";
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/korokoro 1.16.0.