Reference · Where every tie sits
Voicetype
A language ready to write with: the words with any replacements, and the formats.
Import it
import type { Voice } from "@johnmorrisdotca/taisen-brackets/layout";
Also exported from: @johnmorrisdotca/taisen-brackets
Definition
interface Voice {
locale: Locale;
words: Words;
number(n: number): string;
date(iso: string): string | null;
upper(text: string): string;
round(name: string): string;
team(team: Team): string;
}
Members
| Name | Type | Description |
|---|---|---|
locale | Locale | |
words | Words | |
number | (n: number): string | A number in the language's own digits and separators. |
date | (iso: string): string | null | A date as the language writes it ("Dec 18, 2022", "2022/12/18"), or |
upper | (text: string): string | Capitals, by the language's own rules (not for Japanese). |
round | (name: string): string | A round's name in the language. |
team | (team: Team): string | A team's name in the language. |
Examples
import { voiceOf, type Voice } from "@johnmorrisdotca/taisen-brackets";
const voice: Voice = voiceOf({ locale: "fr" });
console.log(voice.upper("finale"));FINALEWhat it prints (run when this page was built)