type
PhrasesA phrase set: key → template string, where {1}/{2}/… are positional substitution slots.
Docs / API / Modules / translations
@s2script/sdk/translations
SourceMod-style i18n (per-client language, phrase files, {1} formatting).
import { Phrases } from "@s2script/sdk/translations";Author-time types ship in the npm package; the engine injects the runtime at plugin load. Add @s2script/sdk to your plugin's dependencies.
Generated from the shipped type definitions.
PhrasesA phrase set: key → template string, where {1}/{2}/… are positional substitution slots.
TranslationsSourceMod-style translation registry: seed a default phrase set, override it per language from
translations/<code>/<name>.phrases.json, then translate a key for a given client's language.
import { Translations } from "@s2script/sdk/translations";
Translations.load("trdemo", { Greeting: "Hello {1}", Bye: "Goodbye {1}" });
console.log(Translations.translate(-1, "Greeting", "world")); // "Hello world"load(name: string, seed: Phrases): voidseed is the built-in English default; translations/<code>/<name>.phrases.json overrides per language.translate(slot: number, key: string, ...args: (string | number)[]): stringkey for slot's language (slot < 0 = the server default), substituting positional {1}/{2} args.setDefaultLanguage(code: string): void