Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can genstrings work on custom #defines?

The macros iOS has for creating localized strings are pretty awesome when used with genstrings. However, I'd like to create my own #define on top of one of the macros like so:

#define MyLocalizedStringWithDefaultValue(key, tbl, val, comment) \
NSLocalizedStringWithDefaultValue(key, tbl, [NSBundle mainBundle], val, comment)
#endif

Essentially, I always want to be going against the main bundle, so I don't feel the need to type it out every time. This works great in code, but genstrings doesn't pick up my macro. Is there anything I can do to make it pick up my custom macro? I saw on the man page that there's a routine parameter that looks like what I'm trying to do, but I was unable to get it to work.

like image 904
Mike Avatar asked Dec 14 '12 15:12

Mike


1 Answers

Type genstrings to see the help text. Notice the -s substring option. You want something like:

genstrings -s MyLocalizedString -o someDir *.m
like image 52
rmaddy Avatar answered Nov 07 '22 13:11

rmaddy