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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top