MyLocalization Data Flow Diagram
Last updated
Last updated
The above figure shows the workflow of the MyLocalization system. From left to right, prepare the resources and text that need to be localized first, and it is usually easier to encounter the text requirements that need to be localized.
No matter what localization requirements are encountered, first create a LanguageTypeCData resource to define the language type suitable for your project requirements, and then add language types as needed.In addition, add a game object in the current scene, attach the LocalizationSetting component, and set the LanguageType CData resource to the languageType attribute of the LocalizationSetting component.
When text localization is required, create a new StringTable resource in the Assets directory (usually automatically associated with the LanguageTypeCData resource set in the LocalizationSetting existing in the current scene). Then open the StringTable Resource Editor, where you can edit the text's localization and associate the language audio files associated with the text.Much of the text used for the UI does not need to be associated with an audio file.
After these texts are processed, add the corresponding Setter component on the UI component or other forms of display components to be localized, for example, if you want to localize the Text component of Ugui or the text display component of TextMeshPro, You need to add the UITextSetter or UITextStaticSetter component to the same game object;If you want to localize the DropDown component, you need to add the DropownSetter component, and the rest of the text appears similar.
Make some settings on these Setter components to associate them with the text fields set in the StringTable, and then they can be localized normally.
For other non-text localization requirements, you need to do this:
Find the LocalizationSetting component in the current scene. If not, create a new one. Set the corresponding type of localization item (Leaf) in the [Localization Item Container] attribute. After setting, note that it is likely to lock the field name of Leaf, which means that this field name will not be modified in the future.Because the Setter component is associated with the Leaf's field name (except for the UITextSetter or UITextStaticSetter components), do not modify the Leaf's field name without losing the association.
After Leaf is set, you can add the corresponding Setter component on the UI component or other forms of display components that need to be localized, and then associate the field name of Leaf in the Setter component.
If additional localizations are required, the above process can be repeated. For LanguageTypeCData resources and LocalizationSetting components, typically only one project is needed to meet the requirements, and no more needs to be created. With that done, the localization process is complete.