genstrings stopped working

7 views
Skip to first unread message

Jens Alfke

unread,
Apr 10, 2010, 4:23:01 PM4/10/10
to murk...@googlegroups.com
I was about to commit, and noticed that none of the new localizable strings I added to the source have been added to Localizable.strings. I eventually tracked this down to the following line in Localize.py:
runCommand('genstrings', '-o %s “%s"' % (toLangLproj, globString))
Specifically, the double-quotes around the globString (whose value is “./**/*.[hm]”) are preventing it from being expanded when the genstrings command runs. If I remove those double-quotes, it fixes the problem.

I first thought this was another side effect of my using tcsh instead of bash, since the runCommand function is using a shell to do the command parsing; but if I try
echo "./**/*.[hm]"
in either bash or tcsh, it outputs the literal glob string instead of a list of filenames. So I think this is an actual bug in the Python script.

It would be easy to overlook the bug because it has no visible effect — oddly, genstrings doesn't complain if you give it nonexistent filenames. So all that went wrong is that Localizable.strings silently stopped being updated.

The new Murky file viewer window allows me to pin the blame on revision 7a9a21, whose comment includes "wrapping the arg to genstrings in quotes”. David, was this necessary to fix a bug, or just a speculative change? I’m going to take it out in my next commit, because it breaks localization.

—Jens

Reply all
Reply to author
Forward
0 new messages