Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find untranslated strings. NSLocalizedString()

I'm using NSLocalizedString() for all localization stuff. The project is very big. We support many languages. Is there a way that I can easily extract strings that are not in the Localizable.strings but were wrapped with NSLocalizedString.

Example. Let's say I have somewhere in my code:

NSString *message = NSLocalizedString(@"Sample message");

But developer forgot to put this string in Localizable.strings files, so it won't be translated. Is there a way to extract untranslated strings from the source code?

Also, I don't want to use genstrings tool. I already have a very big NSLocalizable.strings files. genstrings tool generates a new one with all strings wrapped with NSLocalizedString removing all former translations, which I do not want. I just want to extract untranslated strings and NOT ALL the strings marked with NSLocalizedString().

Thanks, Rafal

like image 692
Rafa de King Avatar asked May 14 '12 09:05

Rafa de King


1 Answers

Check out the genstrings tool, that does exactly this.

EDIT: Try merging the genstrings generatet strings file with your existing one using the FileMerge tool in XCode (XCode > Open Developer Tool).

like image 195
DrummerB Avatar answered Sep 16 '22 15:09

DrummerB