scmJS docs

api.i18n

I18nApi

The plugin's words in the editor's language: its own catalogues, and a t over them.

The plugin's words in the editor's language. The editor's own chrome is translated the same way — English text as the key, a flat catalogue per language — and a plugin brings its catalogues and gets a t over them: an untranslated string is its own English. Placeholders are {name}, {n, plural, one {…} other {…}}, {x, select, …} and, for Korean, {name|을} (the particle agrees with the value).

Members

language

readonly language: string;

The editor's language, a BCP 47 primary tag: "en", "ko".

register

register(catalogues: Record<string, Record<string, string>>): Disposable;

Add catalogues, keyed by language; a later one overrides earlier entries.

t

t(text: string, params?: Record<string, string | number>): string;

The text in the current language, placeholders filled; the text itself when there is no translation.

tc

tc(context: string, text: string, params?: Record<string, string | number>): string;

t with a context, for the same English words meant differently in two places.

scmJS 0.6.2 + main@dd79a77 · Generated from the repository. The source is under the MIT license, which does not cover what ATTRIBUTION.md lists. StarCraft and Brood War are trademarks of Blizzard Entertainment; this project ships none of their data.