Copyright © 2025-2026 Candy ArtsTranslating Other Content
Candy Dialogue Engine's own localization tables cover Actor names and UI texts. Anything else your Dialogues display, such as item names, place names or quest titles, is translated through localization tables of your own, with the translate() function.
Adding a Localization Table
To add a table, create a script in the Candy_DE/Scripts/User_Data/Localization_Tables folder. The script extends CandyDataTable and declares one variable, which contains the table:
extends CandyDataTable
var item_names = {
"Iron Sword": {
"French": "Épée en fer",
"Japanese": "鉄の剣",
},
"Healing Potion": {
"French": "Potion de soin",
"Japanese": "回復薬",
},
}candy_de.item_names.
Name the script after its variable, such as Item_Names.gd. Sub-folders only sort the tables. The scripts you add to this folder are 'safe': updates never overwrite or remove them.
Rules for your own tables:
- Don't name the variable like an existing table or a setting in Candy_Properties.gd, such as display_names or language.
- Don't name two scripts identically, even in different sub-folders. Only one of them is loaded, and the duplicate is reported.
- Only declare variables in the script. It is read once when the game starts, then discarded.
CandyWriting.get_shared().translate(engine, caller, text, table)| Argument | Description |
engine | The Engine whose current language applies. |
caller | The object making the call. Pass self. |
text | The text to translate: a key of the table. |
table | The table's variable name, such as "item_names". It can also be a ¢ expression that returns a Dictionary. |
var engine: CandyEngine = $DialogueUI/CandyEngine
item_label.text = CandyWriting.get_shared().translate(engine, self, "Iron Sword", "item_names")self is the Engine running the Dialogue, so it is passed as both the Engine and the caller.
For example, a Spoken Line displays the name of the player's current weapon with a text variable. Its Default and French Variations contain the same expression:
Default Is that ¤¢CandyWriting.get_shared().translate(self, self, globals.weapon, "item_names")¤ new?
French C'est nouveau, ¤¢CandyWriting.get_shared().translate(self, self, globals.weapon, "item_names")¤ ?globals.weapon is "Iron Sword", the Default Variation displays "Is that Iron Sword new?" and the French Variation displays "C'est nouveau, Épée en fer ?".
The same expression translates an Actor property that isn't a name, such as a title stored in Title: ¤¢CandyWriting.get_shared().translate(self, self, candy_de.actors.Ryn.Title, "actor_titles")¤, with a table of your own named actor_titles.