Take the 2-minute tour ×

OK, I am officially flabbergasted. I started an IOS project some time ago, and juggled around with localization a bit at the start, which became a bit of a mess, because I did not know how to do that properly yet.

Now I have decided to do the localization from scratch, and therefore threw away all the .strings files, and created a proper multi-language structure. I started with empty Localizable.strings files, and run the app to see whether I cleaned up everything properly. With empty Localizable.string files, I assumed my "NSLocalizedString" calls would simply return the key as text. They don't. They still return the old text that I had in the old .strings files.

Just to be sure, I put an NSLog statement under one of the NSLocalizedString calls, as such:

NSString *text = NSLocalizedString( key, nil );
NSLog(@"key=%@ text=%@", key, text);

Then I search my whole harddisk for the text that was returned. No file on my harddisk contains the string that NSLocalizedString returns. And it is a completely different string than the key, so it cannot be constructed by NSLocalizedString either.

Anybody knows how this can happen? Is the old info cached somewhere by XCode? How can I persuade the tool to use the new Localizable.strings files? Obviously, I have already 'clean'ed and rebuilt the whole project.

share|improve this question
You might try deleting the app from your device and running it again. I have noticed in the past that deleted resources are not deleted on the device during development. –  Brian Walker Jan 24 '12 at 15:47

3 Answers 3

up vote 4 down vote accepted

Try to delete the app from the phone, then clean your project and install the app afresh.

If it still doesn't work, check you haven't somehow messed up with the Build Rules (Xcode 4 -> select your target -> tab "Build Rules") There, check if you don't have too many "CopyStringsFile" rules that aren't using "CopyStringsFile". If so you can remove them all but one.

share|improve this answer
Thanks. Deleting the app from the device (the simulator in my case), did the trick. –  fishinear Jan 24 '12 at 16:01
Yes, deleting the App from the simulator made it work. –  RocketMan Apr 11 '13 at 23:57

If you are testing on the simulator, try resetting the simulator using the "Reset content and settings..." option in the "iOS Simulator" application menu.

When you redeploy a new build of the app, even after a clean build, it often doesn't clear out the cached content of the previously built version.

share|improve this answer

Did you also clean build folder? command + option + shift + k or go to product, press option, there will be a clean build folder, usually, resources file are cached, any resources file replacement (file with same file name but different object) might not be detected by XCode

Also, deleting app / resetting simulator does help. Deleted files sometime don't get removed when you redeploy.

share|improve this answer
Thanks for the tip, I did not know about that possibility. Unfortunately, it did not help –  fishinear Jan 24 '12 at 15:57
actually, have you tried deleting the app from your simulator / device? it might help! –  X Slash Jan 24 '12 at 15:59

Your Answer


