define(tag: string, words: { [string]: string }) → void
Add a language, or restate lines of one, from code: `Lang.define("es", { place = "Colocar {{ piece }} {{ cost }}", ... })`. Keys left out read in English.
| arg | type | description |
|---|
| tag | string | |
| words | { [string]: string } | |
fill(s: string, values: { [string]: any }?) → string
| arg | type | description |
|---|
| s | string | |
| values | { [string]: any }? | |
tag( ) → string
The player's language among the kit's languages (i18n.pick over Lang.TAGS).
has(full: string) → boolean
| arg | type | description |
|---|
| full | string | |
has(key: string) → boolean
Does any layer (a world catalog, a language added in code, the kit's own words) hold `key`?
| arg | type | description |
|---|
| key | string | |
t(key: string, values: { [string]: any }?) → string
The text of `key` in the player's language, its `{{ name }}` parameters filled from `values`.
| arg | type | description |
|---|
| key | string | |
| values | { [string]: any }? | |
snake(s: string) → string
"wallWindow" -> "wall_window": catalog ids as key parts.
| arg | type | description |
|---|
| s | string | |
named(prefix: string, id: string, part: string, fallback: string?) → string
| arg | type | description |
|---|
| prefix | string | |
| id | string | |
| part | string | |
| fallback | string? | |
pieceName(kind: any) → string
A piece kind's name / description in the player's language (a world's own piece: its translation, else the name it was defined with).
| arg | type | description |
|---|
| kind | any | |
pieceDesc(kind: any) → string
| arg | type | description |
|---|
| kind | any | |
styleName(st: any) → string return named
A style's, ghost look's, build menu's or snap mode's name / description, the same way.
styleDesc(st: any) → string return named
ghostName(g: any) → string return named
ghostDesc(g: any) → string return named
menuName(m: any) → string return named
menuDesc(m: any) → string return named
snapName(s: any) → string return named
snapDesc(s: any) → string return named
categoryName(c: any) → string
A piece category's name.
code(code: string?, values: { [string]: any }?) → string
The text of a refusal `code` (with its values) in the player's language; nil for a code the kit does not know.
| arg | type | description |
|---|
| code | string? | |
| values | { [string]: any }? | |