Localization system
- Last UpdatedDec 04, 2023
- 1 minute read
XR Engine and therefore all XR runtime applications, include a localization system that is based on language specific dictionaries.
Instead of directly embedding the localized text content in the scripts, the developer can create a uniquely identified text reference key and then provide localized text for the key in all the supported language dictionaries.
You can select language at loading time, but it's also possible to change language at runtime, which enables the development of multi-language applications.
XR Studio contains a Language Editor tool to easily create and maintain language dictionaries.
Code example
This a code example for localization. Depending of the currently selected language, the text will display in English or Italian in the Text2D element.
[CODE file]
<Text2D name="aLocalizedText" size="2000 40" position="100 10" text="@lang:textEntry@" />
[ENG dictionary file]
<?xml version="1.0" encoding="utf-8"?>
<dictionary>
....
<item key="textEntry" value="An english text" />
....
</dictionary>
[ITA dictionary file]
<?xml version="1.0" encoding="utf-8"?>
<dictionary>
....
<item key="textEntry" value="Un testo in italiano" />
....
</dictionary>