Plugin for localization keys. Works with MeshText/UIText/TextMeshPro
Support suncubestudio@gmail.com - subject of mail [Localization Sevice]
- Import plugin from Asset Store or copy from GitHub
- Create and Load .CSV
- Add UILocalization component to MeshText/UIText/TextMeshPro
- Help tools: Analytic of Keys
Plugin use .CSV files for localization key/value. Create a table of localization and export it to a .CSV file. You can use for this google sheets, because all your team can edit this with sync.
Create for each language its own list.
Save and export each localization to file “Localization” .CSV file or use Download manager
Copy/put the file to the resources (Resources\Localization). Rename the file to language name. !!! Names of languages you can see here
It is possible to download the latest localization changes from your Google sheet. Plugin uses the Google Sheets API . If you want to use your project for working with tables create here .
This tool can be opened by path Window / Localization
Next - open your localization page and copy google sheet IDKey
Copy and paste this to SpreadSheetKey :
Check the path to localization files will be downloaded. (! it must be a folder ../Resources/Localization)
Press SET button
Get session key (this case will be repeated if the key is expired or invalid)
Copy and paste this to AccessCode field:
Press SET button
Now you need to get list of localization , press GET LIST
A list of localizations will shown like:
-
List can be updated
-
Localization can be removed from the list of updated localizations
-
Download selected list
-
Select your text component on the scene MeshText/UIText/TextMeshPro and add the component UILocalization.
-
Set localization’s key or write to the Key field
If the entered key does not exist you will get an error. Check that the key in the localization!
New version include ability to localize multikey. This is very useful when you using tags.
You need enter the keys for each id {0...N}
LocalizationService is singleton, for call this use
LocalizationService.Instance
- When it is first started, it get and set system language by Application.systemLanguage. You can change logic of first initialize localization value in LocalizationService.GetLocalization().
for example, you can use this enum for languages values in your project
enum SystemLanguage
LocalizationService.Instance.Localization = SystemLanguage.English.ToString();
Get the key in the code
// for current set localization
LocalizationService.Instance.GetTextByKey("localization1");
or
"localization1".Translate();
You can encode the transition to a new line by adding the translation value "\n". UILocalization make this automaticly, but if you need made this from code use extension for string ParceNewLine().
// key="line" value = "first line \n secondline"
UIText.text = "line".Translate().ParceNewLine();
Path to open Window / Localization / Analytic keys This tool will allow you to analyze all keys that are used in the project (!Before starting you need save all changes in the current scene)
Press "Find Use"
-
Update Analysis
-
Search prefabs and scenes
-
Places where there are errors when using
Errors Types: EmptyKey - key not set KeyNotFound - key not found *TextComponent_NotFound *- no supported component on GameObject - MeshText / UIText / TextMeshPro
- List of keys that are not used
! Does not check usage in the code of the project like LocalizationService.Instance.GetTextByKey("localization1")