Well, I'm officially stunned. Some time ago, I started an iOS project and got a little confused with localization, which became a bit messy because I didn't know how to do it yet.
Now I decided to do localization from scratch and, therefore, threw away all the .strings files and created the correct multilingual structure. I started with empty Localizable.strings files and launched the application to check if I cleaned everything correctly. With empty Localizable.string files, I assumed that my calls to "NSLocalizedString" would simply return the key as text. They do not do this. They still return the old text that I had in the old .strings files.
To be sure, I put the NSLog statement in one of the NSLocalizedString calls, as such:
NSString *text = NSLocalizedString( key, nil ); NSLog(@"key=%@ text=%@", key, text);
Then I scan my entire hard drive for the returned text. On my hard drive, the file does not contain the string returned by NSLocalizedString. And this is a completely different line than the key, so it cannot be created by NSLocalizedString either.
Does anyone know how this can happen? Is old information cached somewhere in Xcode? How can I convince the tool to use the new Localizable.strings files? Obviously, I already "cleaned and rebuilt the entire project."
source share