Frage

I'm facing this weird problem (both on simulator and device): My app is localized in many languages, if I build and run the app on the device (as well as on the sim), and the app was not installed, everything seems fine, but than, if I build and run again without removing the app, or if I close and reopen the app manually, the it gets localized in italia as if there is no localizable.strings file and the only language is italian (I'm italian, but both my mac and my Device are in english).

Here's a flow:

1) The device is in Italian -> I build and run the app -> it is localized in italian as it should be.

2) I close the app -> switch the language of my iPhone to english -> reopen the app -> the app is still in italian.

3) I delete the app (with language set to english) -> I build and run the app -> the app is in english as it should be.

4) I close and reopen the app (or build and run again) -> the app switches back to italian even if the device language is in english.

than there's no way to get to english again unless I delete and rebuild the app, and it just works for the first time.

Any idea on this strange behaviour? I'm looking around but find no hint to solve this problem.

War es hilfreich?

Lösung 2

There was an error in a framework I was using which was setting programmatically the property AppleLanguages to "it" in the user defaults.

Andere Tipps

In my tests (which have only been on the simulator), you need to either:

A. Turn on/off the device after changing the language B. Delete the app and reinstall after changing the language

In order to see the language change take effect. I would try turning the device on/off and changing languages settings and see if the language sticks this time.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top