Localization: application crashes when language is changed in simulator - iphone

In order to localize my application, I created Localizable.strings for three languages. I didn't need to localize any nib files since I'm not using any in my project. No images were localized, only the strings. In the code, I read the strings using NSLocalizedStrings(#"key", #"comment"). The Localized.strings files use UTF-16 format. The strings look like this: "Projects" = "Projekte";.
When I run the app in the simulator and change the language, my application that's running in the back crashes (SIGKILL). If I rerun the application, I can see that the language has been changed because the label of the Edit button is in German, but all my strings are still in English.
I read many threads about localization and I have three iOS books at home but I still don't know what I'm doing wrong.
Did I forget to set up something else?
Any ideas?

It's because when you change the language of your device, SpringBoard kills all the apps so that they will 'load' new language at the next startup. You can't change the system language without your app being killed. It has to be killed if you want to save your new language.
Your app doesn't crash. It's being killed (SIGKILL) by iOS.

Related

iOS App doesn't work in other language

My iOS-App was first German and English. As it was just a fault, I removed the English localization. Somehow if I change the language in the iOS Simulator to english not it loads the old storyboard that doesn't even exist anymore. I cleaned the folder and there is now only a base storyboard. Although I cleaned the Project the App is still crashing after start (because it's loading an old storyboard of prior App version (I removed english localization in 1.1, and now in 1.2 it still loads the 1.0 storyboard).
This is really weird, how can I achieve that the App ALWAYS uses the same storyboard, no matter which language? I already removed the english localization!
Thanks very much!
From my understanding based on a previous experience, if you are localizing an application you need to keep the English one. Because it will default to English if the device is not set in the language that you are supporting.
(Have you notice in the setting app how english is always the second choice and that you can't change the order like on the desktop to default to something else before english)
So if you are planning on supporting only 1 language remove all localization into your application. Because other wise it would default to a non-existing asset and crash.
That would be my best guest for a try.
Have you delete the application on your device after all those change and a clean up may be necessary. I've notice that file, (especially not code file) that get deleted have a tendency to lay around the executable.
And if you get file (1) b.xml and (2) fr.lproj/b.xml even if the device if in french the french one (2) won't get used. The system will see (1) first and think there is no localization for that file.
As for "losing" your German Xib. If you take a copy out of your de.lproj (and put that copy up a directory in the file system it should work)

iPhone - Wrong Localization after Changing the Language

I am developing an application that supports English and Arabic localization. If the iPhone language is set to Arabic, everything is fine. If I changed the language to English, the app continues to change in Arabic.
I tried the following:
Terminating the application before changing the language.
Removing the application from iPhone. Changed Language to English. Restarting the iPhone. And building the application from scratch (still in Arabic!).
I tried cleaning using shift-command-k (also failed).
I removed the application. restarted the phone. Cleaned the build folder (shift-option-command-k). Then I built the application, and guess what, it's still in Arabic! (How, in God's name, did the iPhone know that I used Arabic before?! I restarted the phone many times!, removed and clean the build directory!).
So, what do you think I should do?
Note: other apps that provide localization are working fine.
Does the project have en.lproj Localizable.strings file?
Thanks #Shatou Dev ,I make my comment as an answer.

Lock my iPhone app to a specific language (Localization)

I have an Xcode4 project where I have support for several languages (localization files) .. My text and xib files change correct when I change languange on my iPhone ..
My Question is;
Can I make a release to a specific languange, even if I have several localization files?
Force my app to use only one localization?
My idea would be to set a flag in the info.plist file like;
Localization = English (Lock my app to the enligsh language)
You can do this by deleting localized strings and nib files. I don't think you can lock your app to a particular language (If localization support is there for other language).
If the localized.lproj folders are in the bundle, iOS will use them. The easiest way would be to remove your localized resources folders from the bundle and build the app.
You could probably programmatically set code a workaround in your main.m class file, by stating only to use en.lproj but I can't imagine this will be either pretty or useful.
Side note: You can set your default project localisation in the Target > Info pane. Look for key: Localization native development region

Is it possible to localize the app icon and Default.png?

Is it possible to localize the app icon and Default.png files? Do I just drop them in the respective language folders or must I do something else?
As per my comment, there's an answer elsewhere, but you can read more in the Internationalizing Your Application section of the iPhone Application Programming Guide. There's an example of how to structure your language files in your app bundle, for example.
The correct answer is that it is not possible to localize the app icon.
An iOS application should be internationalized and have a
language.lproj folder for each language it supports. In addition to
providing localized versions of your application’s custom resources,
you can also localize your application icons and launch images by
placing files with the same name in your language-specific project
directories. Even if you provide localized versions, however, you
should always include a default version of these files at the
top-level of your application bundle. The default version is used in
situations where a specific localization is not available. For more
information about localized resources, see “Localized Resources in
Bundles.”
https://developer.apple.com/library/ios/#documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html
Apple docs update/change frequently. This is the correct link at this point in time. Also, I haven't actually tried localizing the app icon/default images, but Apple says it works so why not :-)
This same question appears numerous times on stackoverflow.

The wrong language is shown in App Store!

Last week I distributed my first app to the App Store. what i've to see was, that the app language which is shown in appstore is not the right one. my app is just in German, but in App Store english is shown up.
Can somebody tell me what I've exactly got to do, so that the language in the appstore is German? I know I need a "de.lproj" folder, but i don't know what this folder should contain and what I've got to do step by step to realize that the right way.
All you need to do is write "German" (without the quotes) at the "Localization native development region" property in your info.plist file of you application.
I think you forgot to mention the default language of your application in your info.plist file.