Helps Cocoa applications localization by detecting unused and missing keys in '.strings' files.
Path of an Objective-C project.
- warnings for untranslated strings in *.m
- warnings for unused keys in Localization.strings
- errors for keys defined twice or more in the same .strings file
$ python objc_strings.py -p /path/to/obj_c/project ./MyProject/en.lproj/Localizable.strings:13: warning: unused key in en.lproj: "Misc" ./MyProject/ViewController.m:16: warning: missing key in fr.lproj: "World"
$ chmod +x objc_strings.py
objc_strings.pyto the root of your project
add a "Run Script" build phase to your target
move this build phase in second position
set the script path to
Some may experience UnicodeDecodeError when running the script. The problem is that the script runs through all directories to look for .strings files, which may include already compile .strings files which can not be parsed. Often you have some in Build/ or if you integrate CocoaPods ( Pods/ )
To prevent this you can add dirs which you want to have excluded like this
or if you are on terminal
$ objc_strings.py --project-path /path/to/obj_c/project --exclude-dirs=['Build','Pods']
- Scan Interface Builder (.xib) Files for localized Strings