Search code examples
iosswiftxcodelocalizationlocale

Why does my iOS app only detect the current language of device correctly on first run?


enter image description hereI am localizing my iOS app, and in the Simulator it runs correctly in my chosen language every time. it only detects the language properly the first time the app runs. Every other time I recompile and run my app on the device, it detects "en" as the language.

If I kill the app after the first run, and restart it on the device, it continues to detect the language properly. But if I kill the app and then recompile/restart via Xcode after the initial run, it will load with "en" (English) detected instead. After that, killing and re-starting the app continuously detects as English unless I delete the app completely, and recompile/reinstall/run the app via Xcode. The cycle then repeats... subsequent rebuild/restart without first deleting the app from the device results in misdetection

=>targeting to get arabic language,but from second run its not working?

=> Obviously something must be wrong in the way my project is laid out, or perhaps in one of the data files

-----i am trying this from last 1 week till not working, get me out of this problem!

i.stack.imgur[![.com/DvSHE.png]4]4


Solution

  • Go to "Edit Scheme..." and make sure that "Application Language" is set to "System Language":

    enter image description here