How to set initial language for iOS app in Xcode or Swift?

Viewed 63

I have an application that supports two different languages. I want it to start with the local language (that is different from the system language).

I've tried setting it manually in code:

UserDefaults.standard.set(["fa"], forKey: "AppleLanguages")

but this needs the app to restart to be applied.

Also, I've set the CFBundleDevelopmentRegion. But surprisingly it's not working when I enabled the localization!

Note: my app is supporting language selection from settings, but this is NOT a solution for me because it always defaulted to the system's language.

Requirements:

  1. RTL support.
  2. Read the proper translation from the desired localization file.
0 Answers
Related