Translate

Family: Studio · 2 forms

What it does

Returns the text of a translation key in the game's current language.

Syntax

1
Translate(textKey string) → string
2
Translate(textKey string, varsJson string) → string

Parameters

NameTypeIn formsMeaning
textKeystringallThe key in the scene's localization table, such as menu.start.
varsJsonstring2Optional JSON object whose values fill the {{name}} placeholders of the text.

Every form returns

string

The translated text. A key missing in the current language uses the fallback language; a key missing everywhere returns the key itself.

Good to know

  • Seeing the raw key on screen is the visible sign that a translation is missing.

Example · generated

Form 1, the short one

DO  Print(Translate("score"))  Sync()LOOP

Form 2, with every argument

DO  Print(Translate("score", "{}"))  Sync()LOOP

Translate is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

133 commands in Studio