I have created an new Xcode project and trying to setup string localization.
I have added a new file called
“localization.strings’ with the following content.
“Login” = “English text2”;
I have added the second localization to the Project > Info section in the latest version of Xcode.
I then tick the box on the right to add French for the localization.strings file. Once this is added I can run/build the application but the strings no longer link to this file.
For example, if i update the original english version above, to “testing text eng” for example, it still shows the original English text2.
Any idea why this might occur? The app is too large to post and there are no build errors, the file is not corrupt, missing, incorrect encoding.
You need to make a clean build and delete the app from the simulator and/or your device, and then everything should work. You only need to do this once.
Before you added any localizations, your strings file would end up in the root of your application bundle, e.g.
MyApp.app/Localizable.strings. This would then be copied into the Simulator and/or your device when you run the app.After adding a localization, the file’s contents is moved into localization-specific subdirectories such as
MyApp.app/en.lproj/Localization.stringsandMyApp.app/fr.lproj/Localization.strings. But the old file in the root bundle is still hanging around in the Simulator and on your device, and that’s being found before the others. So do a clean build, delete the app from the Simulator and your devices and that old file will be removed.