📝 A script that finds unused localized strings generated by SwiftGen.
- It finds all string keys in
.strings
files - Converts the keys into Localize generated format:
"homeScreen.FULL.15.main_title.
=>HomeScreen.Full._15.mainTitle
- Searches through the source code and finds which keys are not used
- Open the project and build
- Find
UnusedKeys
executable file in Products folder in the Project Navigator in XCode - Drag and drop to your terminal
- Pass a directory which contains your
.strings
file as the first command line argument - Pass directories where you want to search in.
- Press enter. Magic 🪄
Example: /Users/username/Library/Developer/Xcode/DerivedData/UnusedKeys-abc/Build/Products/Debug/UnusedKeys /Users/username/Projects/AwesomeProject/Resources /Users/username/Projects/AwesomeProject/
This script is not guaranteed to process perfectly