10

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?

Community
  • 1
  • 1
strave
  • 1,491
  • 2
  • 16
  • 26

1 Answers1

16

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.

akashivskyy
  • 44,342
  • 16
  • 106
  • 116
  • Got it! Anyway, as I wrote before, when I re-run my app after it's beein killed, the strings are still in English, even after changing the language to German. – strave Jul 08 '11 at 15:53
  • Are you sure you localized all the strings properly? – akashivskyy Jul 08 '11 at 16:03
  • As I wrote, I created the Localized.strings taking this as an orientation: http://rndm-snippets.blogspot.com/2010/11/best-practice-localizationinternational.html (#1 and #2) but with xcode 4. When I see my project in the Finder, there is a lproj folder for every language. Is there anything else that should I consider? – strave Jul 08 '11 at 16:27
  • This is very strange. I got it to work in a very weird way. My lproj folders were called de, en, es. I created duplicates called German, English, Spanish respectively. Re-run the application and it worked. Now I can remove the new folders (German, English, Spanish) and it still works. No idea what happened. – strave Jul 08 '11 at 16:38
  • Maybe cleaning targets helped ;) – akashivskyy Jul 08 '11 at 16:41