Parsing the scenes for Missing or Unused Keys
Parsing scenes for Missing or Unused Terms
One of the major issues developers found when setting the localization its to keep track of which of the keys are no longer used in any scene. As well as finding which keys are used in the scenes but hasn't been set in the localization data.
To solve this problem, I2 introduces a tool that Parses the scenes and finds how many times those keys are been used or if they are missing from any of the LanguageSources.
To execute the tool, Select the LanguageSource (e.g. I2Languages.prefab) and go to the Tools tab.
The top section will show all scenes added to the project Build Settings.
There are also shortcuts to quickly select them:
- All the scenes
- None clears the selection and make easier to hand pick a subset
- The Used scenes, which are the scenes enabled on the Build Settings.
- The Current scene. It is the one currently open in the editor.
After selecting which scenes are going to be searched, select the Parse Labels tab in the bottom panel.
When clicking on the Parse Labels button, the editor will open each of the selected scenes, and search through all of the localizable objects (Text, UILabel, TextMesh, etc) components to track Terms usage.
After the search is completed, the editor will return to the initial screen and open the Keys tab to show all the Terms found during the parsing and how many times they are used if any.
In the Keys list, each of the keys will show a button with the number of times that key was used in the scenes.
By clicking that button, the editor will select all labels in the current scene that are using that Key.
Furthermore, the Terms list can be filtered based on the usage. At the top of the Keys List there are three buttons to toggle showing the Used, Not Used and Missing terms.
- Used: Adds or Remove to the list the terms from the LanguageSource that are actually used in the scenes. They will always show a number higher than 0 because they are used at least once.
- Not Used: These are the keys that are in the LanguageSource but are not used in any of the labels or sprites in the scene. It's safe to remove this keys as they are not used.
To easily remove them, just select the checkbox at the left of each term and click the Remove keys button
As a shortcut, the button Not Used at the bottom of the list, will select all of the Keys that are not been used. This avoid having to select them one by one.
- Missing: These are the terms that are used in the scene but are not set in the LanguageSource. This labels are not going to be localized because they wont find their translation in the current LanguageSource.
After selecting the checkbox of each of those missing keys, they can be added to the LanguageSource by clicking the Add Keys button.
Created with the Personal Edition of HelpNDoc: Full-featured Kindle eBooks generator