1

At this point localization in Xcode is driving me mad and I don't know how to solve this problem. My app should be in english and german. I have created both strings-files. I have switched the simulator to german. But everything is still in english. I have reset and deleted the app from the simulator but still the same problem. The really weird thing is that I have deleted all localization.strings from my app and it is still working. Normally the app should crash because it doesn't know where to fetch the data from. But I can start it in the simulator even if the strings are blank. Even if I delete them completely from the app, the app is still working in english. Are these files cached somewhere? I also have deleted all things in the Application Support/iPhone Simulator. But without any result. After I have created complete new strings I have my en.lproj and de.lproj folder where the files are located. The files are blank. Any suggestion is really welcome. Thanks. Have added some pictures to explain it better. Project Settings

Localization.strings

Finder Folder

halloway4b
  • 573
  • 1
  • 11
  • 23

1 Answers1

2

It wouldn't crash if the files were missing, and it could be a red herring if you use keys which are the same in English

NSLocalizedString(@"This is a string in the app", @"Example app string")

vs

NSLocalizedString(@"EXAMPLE_APP_STRING", @"Example app string")

If the strings files were missing and you used the first type of format, the text would look as normal in English. As for your actual problem, ensure you have the file localized and in your target, ensure it is in the copy files build phase, clean and build your app, delete it from your test device, then try again.

coneybeare
  • 33,113
  • 21
  • 131
  • 183
  • Running the german version should display translated texts and also loading different data. Even if I delete the localization.strings from the app everything is still displayed. Even if it loads an URL which is related like this: NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:NSLocalizedString(@"LoadMainDictionary", nil)] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10.0]; – halloway4b Dec 28 '13 at 22:50
  • Clean the build (Product > Clean). Xcode caches almost everything; cleaning the build is the best way to see if you're missing files. If it still builds, the this likely your problem. – SevenBits Dec 28 '13 at 23:06
  • I have cleaned it so often with no result. Now that I have tried so many things to make it work again, it is working as expected. Maybe cleaned it several time did the trick. Thanks. – halloway4b Dec 28 '13 at 23:21