Voice型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A language ready to write with: the words with any replacements, and the formats.
インポート
import type { Voice } from "@johnmorrisdotca/taisen-brackets/layout";
ほかのエクスポート元: @johnmorrisdotca/taisen-brackets
定義
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;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
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. |
例
import { voiceOf, type Voice } from "@johnmorrisdotca/taisen-brackets";
const voice: Voice = voiceOf({ locale: "fr" });
console.log(voice.upper("finale"));FINALE出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。