There’s been a bit of movement on our open source replacement for genstrings. So I figured it would finally be deserving of getting the same treatment as all our other popular repos: automated unit testing, coverage tracking, releases via CocoaPods.
Because of the unwieldy name I refer to it as genstrings2 and it provides the scanning functionally for the Linguan Mac app which was acquired by Peer Assembly.
The DTLocalizableStringScanner project includes a command line target which works as drop-in replacement for original genstrings with a much better scanning performance and a few additional parameters. Then there is also a static library target which you can link into your own Mac app to automate string scanning. For example you can build a localization unit test that checks if all your string tokens have got a translation.
Since this is the first public release, I gave it version number 1.0. The following changes are a collection of changes made to the project in the recent past 2 years.
- ADDED: Support for strings broken into multiple parts and/or lines
- ADDED: Automated Unit Testing with Travis-CI
- ADDED: Automated Test Coverage tracking with Coveralls
- ADDED: Option on command line tool to output UTF8 files
- ADDED: Event-based strings file parser
- ADDED: Support for default table parameter
- CHANGED: Various performance improvements
- CHANGED: Cleaned up the project structure
- FIXED: Compiler warnings
- FIXED: Positional parameters would be added even though they already existed in source string
- FIXED: Stripping of beginning and ending quotes trims off too many characters
Future enhancements should be made via pull requests against the develop branch. The reason being that this triggers automatic unit tests running on Travis-CI which adds a comment to the PR stating if the pull breaks the build. Also all changes should add unit tests to ensure that future changes don’t break the added functionality.
All txt files in the test bundle are scanned with both genstrings and genstrings2 and for passing those need to be identical. So for fixed bugs you can add a new text file containing some test source code to scan.
If you want/need to implement an enhancement not supported by original genstrings then please get in touch how to best add it. The project should remain stable for everybody else who uses it and at the same time I want to prevent multiple clones of it drifting apart with no hope over getting merged.
The version is tagged on GitHub as well as available via CocoaPods.