Localization Manager
Presented via ILocalizationManager interface, this system processes localization in your project.
Currently Localization Manager supports only localization files in *.txt format with key=value pairs inside. But in future we're planning to extend this system functionality, so it will support more localization data formats.
To use this system, inject ILocalizationManager interface into your class, as shown below:
Available methods
This method switches current language to the needed one, passed via lang parameter.
Example:
This method returns localized string with id localization key. If this key is not presented in localization table, it just returns id.
Example:
This method returns localized string with id localization key and custom parameters args. If this key is not presented in localization table, it just returns id. Parameters can have any types, convertable to string. In localization table parameters are presented as {0}, {1}, ... {N} terms.
Example:
So, in case if attemptNumber = 3, this method returns:
This method returns localized string with id localization key and custom parameters args. If this key is not presented in localization table, it just returns id. Parameters can have any types, convertable to string. In localization table parameters are presented as {0}, {1}, ... {N} terms. Parameters in localized string will be shown with text color equal to paramsColor.
Example:
This method finds and translates all Text, TMP_Text and TextMesh components in project. It processes them only in case if that GameObjects also have LangText component with assigned localization key. This method is automatically called right after calling SwitchLanguage method.
This method returns list of available languages in project (languages which have their translation files in Assets/Resources/Localization folder).
This method returns current language in game.
Last updated