Localization Nodes
These nodes allow you to manage the localization and translation system. They read and change the language, and translate the keys of the environment's Localization File (see The Localization File). Virtuademy does not use Unity's Localization package.
Get Nodes
Get Localization Data Node
🔍
Virtuademy>Get>Virtuademy Localization: Get Localization Data
This Node retrieves information about the current localization state.
- ⬆️ Output:
- CurrentLanguage (
string), the name of the currently selected language - CurrentLanguageCode (
string), the language code of the currently selected language - LanguageList (
List<string>), a list of all available language names. It lists every language the application knows, which can be more than your organization offers: the application's own language selector already shows the ones your organization has.
- CurrentLanguage (
Get translation Node
🔍
Virtuademy>Flow>Virtuademy Localization: Get translation
This Node retrieves the translated string for a given localization key.
-
⬇️ Input:
- Key (
string), the localization key to look up.
- Key (
-
⬆️ Output:
- Translation (
string), the translated string for the given key.
- Translation (
The translation is a fixed text in the current language: it does not change when the user switches language. To keep a text right, show it with a Localization Placeholder, which follows the language by itself. When the file has no row for the key, the node returns the key as you wrote it.
Flow Nodes
Set Key Node
🔍
Virtuademy>Flow>Virtuademy Localization: Set Key
This Node sets the localization key on a Localization Placeholder component, updating its displayed text.
- ⬇️ Input:
- LocalizationPlaceholder (
LocalizationPlaceholder), reference to the Localization Placeholder component. If left empty, it defaults to the component on the same GameObject - NewKey (
string), the new localization key to assign (default:"").
- LocalizationPlaceholder (
The new text keeps following the language: after a language change the placeholder shows the same key in the new language.
Set Language Node
🔍
Virtuademy>Flow>Virtuademy Localization: Set Language
This Node changes the application language.
- ⬇️ Input:
- LanguageChoice (
string), the name of the language to switch to, as LanguageList gives it (for exampleItalian), not its code. Use a language your organization offers.
- LanguageChoice (
Event Nodes
On Language Changed
🔍
Events>Virtuademy>Virtuademy Localization: On Language Changed
This event triggers when the application language is changed.
The node starts listening when its graph starts, and only if the application's localization is ready at that moment: otherwise it never fires. Test the language change in the application, and keep the texts that must follow the language on Localization Placeholders.
- ⬆️ Output:
- CurrentLanguage (
string), the name of the newly selected language - CurrentLanguageCode (
string), the language code of the newly selected language - PreviousLanguage (
string), the name of the previous language - PreviousLanguageCode (
string), the language code of the previous language.
- CurrentLanguage (