Skip to content

@vttforge/types / LocalizationApi

Interface: LocalizationApi ​

game.i18n.

localize(id, data) formats placeholders since v14, so format and localize do the same job. _loc is a global shorthand for localize.

Properties ​

defaultModule ​

readonly defaultModule: string


lang ​

readonly lang: string


translations ​

readonly translations: Record<string, unknown>

Methods ​

format() ​

format(stringId, data?): string

Parameters ​

stringId ​

string

data? ​

Record<string, unknown>

Returns ​

string


getListFormatter() ​

getListFormatter(options?): ListFormat

Parameters ​

options? ​
style? ​

"long" | "short" | "narrow"

type? ​

"conjunction" | "disjunction" | "unit"

Returns ​

ListFormat


has() ​

has(stringId, fallback?): boolean

Parameters ​

stringId ​

string

fallback? ​

boolean

Returns ​

boolean


localize() ​

localize(stringId, data?): string

Parameters ​

stringId ​

string

data? ​

Record<string, unknown>

Returns ​

string


sortObjects() ​

sortObjects<T>(objects, key): T[]

Type Parameters ​

T ​

T extends object

Parameters ​

objects ​

T[]

key ​

string

Returns ​

T[]

MIT licensed.