Skip to reading
Game Translations

7. Translate text used by scripts and visual nodes

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView PDF page
On this page

A message written in an action list or visual node is still game text. Write the source sentence in the action's normal Text field, then translate the same sentence through Game Translations.

The catalogue also reads quoted strings from script source. It does not rewrite your GDScript, PCA Script, Lua or BASIC program. Translation happens when the original string reaches a supported game text-display function.

A small scripted message#

Inside the entry function already supplied by a GDScript template, this displays a source message:

Code example
await ShowMessage({
    "text": "The bell is silent.",
    "duration": 2.0
})

Keep the template's existing entry function and parameters. There is no need to create another script class just to translate one message.

With French selected and a French entry for that exact source sentence, the displayed message uses the French words. The same source sentence in a visual message action uses the same translation.

Write a whole sentence when you can#

Prefer a stable source such as Hello, @PlayerName. to building a new string from separate translated fragments. The translation lookup needs to recognise the complete source string.

If a script generates Hello, Ivo. by joining strings, it may no longer match the catalogue entry Hello, @PlayerName. A translator also needs freedom to change word order. A complete sentence with placeholders gives them that freedom.

Quoted strings such as workshop_key, duration or a command name can appear in the script catalogue. Leave them alone unless they are deliberately shown to the player. Translating code vocabulary can break the script without improving the game text.

Before you continue Run the message through the same action or script the player will use. A translated catalogue row alone cannot prove that a custom display path uses it.

Page 17 of 50Permalink
Go to page