Permalink
Newer
Older
100644 35 lines (22 sloc) 1.08 KB
@nst
Dec 10, 2011
1
#### Goal
2
3
Helps Cocoa applications localization by detecting unused and missing keys in '.strings' files.
4
5
#### Input
6
7
Path of an Objective-C project.
8
9
#### Output
10
11
1. warnings for untranslated strings in *.m
12
2. warnings for unused keys in Localization.strings
13
3. errors for keys defined twice or more in the same .strings file
@nst
Dec 10, 2011
14
15
#### Typical usage
16
17
$ python objc_strings.py /path/to/obj_c/project
@nst
Dec 10, 2011
18
./MyProject/en.lproj/Localizable.strings:13: warning: unused key in en.lproj: "Misc"
19
./MyProject/ViewController.m:16: warning: missing key in fr.lproj: "World"
@nst
Dec 10, 2011
20
21
#### Xcode integration
22
@nst
Dec 10, 2011
23
1. make `objc_strings.py` executable
24
25
$ chmod +x objc_strings.py
26
27
2. copy `objc_strings.py` to the root of your project
28
3. add a "Run Script" build phase to your target
29
4. move this build phase in second position
30
5. set the script path to `${SOURCE_ROOT}/objc_strings.py`
31
6. ensure your .strings file are encoded in utf-8
@nst
Dec 10, 2011
32
@nst
Dec 10, 2011
33
![settings](https://github.com/nst/objc_strings/raw/master/images/settings.png "settings")
34
![warnings](https://github.com/nst/objc_strings/raw/master/images/warnings.png "warnings")