ComponentBased Mode
ComponentBased Mode
In ComponentBased Mode, you do not need to manage external files or predefined lists of translations. Instead, this mode allows you to handle translations directly through the LocalizedText component on each text object. This provides a dynamic and flexible solution for smaller projects or when you want to manage translations directly in the Unity Editor.
Using the LocalizedText Component:
Add the
LocalizedTextcomponent to anyTextorTextMeshProUGUIobject in your scene.In the
LocalizedTextcomponent, you'll find a field forTextIDwhere you can define the unique identifier for each piece of text. ThisTextIDwill be used to refer to this particular piece of text across all languages.Below the
TextIDfield, you will find fields for translations. For each language, you can define the LanguageID (e.g.,enfor English,pt-brfor Brazilian Portuguese, etc.) and provide the corresponding TranslatedText.When the language is changed in your game, the
LocalizedTextcomponent will automatically update the displayed text based on the current language. There’s no need to manage external files, as all translations are stored within the component itself.
Example of Adding a LocalizedText:
Add the Component: Select your
TextorTextMeshProUGUIobject and click Add Component. Search for theLocalizedTextcomponent.Define the TextID: Set a unique
TextIDfor this text, for example,greeting.Add Translations: For each supported language, add the
LanguageIDand the corresponding translation:For English (en): "Hello World"
For Brazilian Portuguese (pt-br): "Olá Mundo"
For Spanish (es): "Hola Mundo"
Automatic Update: When the language changes in your game, the text will automatically update to the correct translation based on the
TextID.
Benefits of ComponentBased Mode:
No need for external files: All translations are managed directly in Unity using the
LocalizedTextcomponent.Dynamic updates: When the language is switched, each
LocalizedTextcomponent will update its displayed text without the need for reloading data from files.Great for small-scale projects: This mode is ideal if you have a limited number of texts and want a quick, efficient way to localize them.
Switching Languages:
As with other modes, you can change the language in ComponentBased Mode dynamically. Once the language is switched, all LocalizedText components in the scene will automatically refresh to display the appropriate translations.


Make sure to follow this process for all texts that you want to be translated within your game.
Reminder: LanguageManagerEditor Tool
We offer a free LanguageManagerEditor tool, specifically designed for the LanguageSystem Pro format. It has a friendly interface and supports easy import, editing, and export of files in CSV, JSON, and XML formats. You can use this tool to export global files for the InternalDatabase and GlobalExternal modes or individual files per language for ExternalFiles mode.
For more details on using this editor, see the LanguageManagerEditor section.
Last updated