caique/locale
Every export of caique/locale, with its signature and doc comment: checkLocales, render, sayFor, plus 2 types.
import { checkLocales, render, sayFor } from 'caique/locale';Functions
checkLocales
R6 — refuse a pack whose caique messages cannot be rendered: an id caique does not have, a
placeholder the English lacks, a plural message missing a form its locale selects. Ids that
do not begin caique. are another package's and are left to it. A tag is burgee's to check,
which reads it the same way; here it only has to name an object.
function checkLocales(plugin: {
name: string;
locales?: unknown;
}): void;| Parameter | Type |
|---|---|
plugin | { name: string; locales?: unknown; } |
Returns void
render
A checked message in locale, with the values put back: the plural form by count, then each {name}.
function render(message: Message, values: Readonly<Record<string, string>>, locale: string): string;| Parameter | Type |
|---|---|
message | Message |
values | Readonly<Record<string, string>> |
locale | string |
Returns string
sayFor
function sayFor(locale: string | undefined): (english: string) => string;| Parameter | Type |
|---|---|
locale | string | undefined |
Returns (english: string) => string
Types
Locales
A pack's locales: language tag → message id → translation. Ids outside caique. are another package's.
type Locales = Readonly<Record<string, Readonly<Record<string, Message>>>>;Message
A translation: one string, or — for a message that carries {count} — one per plural form.
type Message = string | Readonly<Partial<Record<Intl.LDMLPluralRule, string>>>;caique/binding
Every export of caique/binding, with its signature and doc comment: resolvePrompts, localise, plus 4 types.
caique/clack
Every export of caique/clack, with its signature and doc comment: CANCEL_SYMBOL, formatInstructionFooter, isCancel, isCI, isTTY, MULTISELECT_INSTRUCTIONS and 54 more, plus 26 types.