Skip to main content

Languages Dictionary

Holds one dictionary of phrases in many languages and gives every phrase its own output port, switching all of them when the language changes. A general localisation node that runs in the editor preview and the browser; it never compiles to the RGS.

Languages Dictionary turns a table of phrases into ports. Fill the Dictionary (Open Table in the property panel) and every phrase key appears as a string output in the node's Translations group, named after the last part of its key (home.title becomes Title), ready to drag onto Text nodes. There is deliberately no key-in, text-out pair: the ports are the keys. Change Language and every port switches at once, then Changed fires.

The dictionary is stored in whichever of three shapes it arrived in, and the table editor writes it back the same way. Name languages with codes such as en, id or pt-BR — auto-detection relies on them:

  • table — a header row naming the languages, then key, translation, … rows. Tab, pipe or comma separated (whichever the header uses), CSV-style quotes for a cell containing the separator; lines starting with # or // are ignored.
  • rows — a JSON array with one object per phrase, [{ "key": "hello", "en": "Hello", "id": "Halo" }]; the key column is the field named key, else the first field. The shape meant for tools that generate or update translations.
  • json — a nested dictionary in either layout, { "en": { "hello": "Hi" } } (language first) or { "hello": { "en": "Hi" } } (key first), addressed by dot paths up to eight levels deep. Set Dictionary Format when auto-detection guesses wrong.

The language actually used is Language; when that is empty and Use Device Language is on, the browser's language; then Fallback Language; and if none of them is in the dictionary, its first language, so a typo still shows readable text instead of bare keys. Each is matched loosely — exact, then case-insensitive, then base language (id-ID finds id), then any regional variant (en finds en-US). The fallback also backs up single phrases, so a half-translated dictionary still renders the rest. Resolved Language reports the match.

Placeholders written as {name} are filled from Variables, the String Format syntax; dot paths reach nested values ({player.name}) and an unknown placeholder is left in place rather than blanked. Phrase keys match exactly first, then ignoring case and surrounding spaces. A phrase missing in both languages shows the key, nothing, or Missing Text, as When Missing says, and Missing fires after that pass.

A dictionary can also arrive while the app runs on Dictionary Data — from an Object node, Import from JSON file or a REST response — in any of the shapes above; it wins over the table. The editor cannot know its keys ahead of time, so list the ones you wire in Extra Keys. dictionaryJson, dictionaryObject and keys are hidden aliases from this node's first iteration, kept only so older projects still load; use Dictionary, Dictionary Data and Extra Keys. For translations served by the platform, use RGS Translations instead.

Inputs​

Dictionary​

DataDescription
Dictionary (translations-table)The phrase table, edited in the property panel with Open Table: table text, a JSON rows array or a nested JSON dictionary. Ships with a two-language sample.

Language​

DataDescription
Language (string)Language to show, matched loosely against the dictionary (id-ID finds id). Empty means the device language if enabled, else the fallback. Default empty.
Fallback Language (string)Language used when Language is not in the dictionary, and for single phrases the chosen language lacks. Default en.
Use Device Language (boolean)When Language is empty, use the browser's language (navigator.languages[0]). Default off.

Translation​

DataDescription
Variables (object)Object whose values fill {name} placeholders in every phrase; dot paths reach nested values.

Advanced​

DataDescription
Dictionary Data (any)A dictionary supplied at runtime — object, rows array or text — that overrides the table; list the keys you wire in Extra Keys.
Extra Keys (string)Keys to expose as ports beyond those found automatically; newline, comma or semicolon separated. Needed for runtime dictionaries and dictionaries over 50 phrases.
Dictionary Format (enum)Forces the nested-JSON layout when auto-detection guesses wrong. Default auto. Options: auto, languageFirst, keyFirst.
When Missing (enum)What a phrase with no translation in the chosen or fallback language shows. Default key, the key itself. Options: key, empty, custom.
Missing Text (string)Text shown for missing phrases when When Missing is set to custom text; placeholders are substituted. Default empty.
SignalDescription
TranslateRe-runs the lookup on demand; every input change already schedules one.

General​

DataDescription
dictionaryJson (string)Hidden legacy alias of Dictionary from the node's first iteration, kept so older projects still load. Not shown in the editor.
dictionaryObject (any)Hidden legacy alias of Dictionary Data, kept so older projects still load. Not shown in the editor.
keys (string)Hidden legacy alias of Extra Keys, kept so older projects still load. Not shown in the editor.

Outputs​

Result​

DataDescription
Resolved Language (string)The language actually in use, as spelled in the dictionary; empty when there is no dictionary.
Languages (array)Every language the dictionary carries, in dictionary order.
Translations (object){ key: text } for every phrase the resolved language itself carries, variables substituted; fallback-filled phrases appear on the ports only.

Events​

SignalDescription
ChangedFires after every translation pass — any input change or Translate.
MissingFires after a pass in which at least one port key had no translation in the chosen or fallback language.

Usage​

  1. Add Languages Dictionary and open Dictionary with Open Table; put language codes in the header and one phrase per row.
  2. Drag each phrase's output onto the Text node that shows it.
  3. Wire a language code into Language, or turn on Use Device Language and leave it empty; keep Fallback Language on your complete language.
  4. Wire an object into Variables for phrases with {name} placeholders.
  5. To load translations at runtime, wire them into Dictionary Data and list the keys you use in Extra Keys.
note

A dictionary with more than 50 phrases gets no automatic ports; list the handful you actually wire in Extra Keys. A phrase key that collides with a built-in output (translations, Changed and the like) gets no port either and is reachable only through Translations.