There are two ways to start using the Localization Editor to manage your strings.
I’ll start with entering your strings in Unity.
Entering String in Unity:
First, create a new Language in the String Table Editor.
Second, enter your strings.
Importing Strings From a Scene:
Localization Editor has the ability to process a scene. Any Text, GUIText, or TextMesh components will be automatically configured with the LELocalize component. The process assigns a unique ID to each string, records the string in the LE system, and configures your scene to work with LE.
Note: Backup your project! Always backup your project before running the Process Scene action.
- Open the scene you’d like to process in Unity.
- Click the “Proces Text in Scene” menu item.
- When the process is done, you will see a summary dialog. The imported strings will appear in the String Table Manager.
Access Strings During Runtime:
If you imported your strings using the Process Text in Scene action, then you don’t need to do anything else to access your strings! To change the language during runtime, read Change Language During Runtime.
Using the LELocalize Component:
First, add the LELocalize component to any GameObject that contains a supported component (Text, GUIText, TextMesh).
Second, if you’d like to create a new key for the string, select New Key and follow the prompts.
If you’ve already created a key, select Use Existing Key and select a key from the drop down list.
If you’d like to reconfigure the LELocalize component, remove it and add it again.
Notes: The checkbox to the right of the Key drop down and the Register LE Events toggle should remain checked. These exist to support the sample scene.
Access Strings from Scripts:
Use the “Generate Static Key Class” menu to generate a class that will contain all your keys.
To access a string from a script call LEManager.Get with the key you’d like to fetch:
string localized_name = LEManager.Get(LEKeys.name);
Changing the Language During Runtime:
You can change the language at any time. All text components that have been configured with the LELocalize component will update when a language is set. To use a language, set LEManager.CurrentLocSet to the language code (or custom language name) you’d like to use.
LEManager.CurrentLocSet = "ko-KR";