In my application users can change localization on the fly without restarting, and I have a date picker with inline preferred style, but it always displays on default language, if I set programmatically locale in 'en' or 'he' - changed the only month but days of the week still display on default language, how I can resolve this issue?
P.S. I tried to change locale in this way:
UserDefaults.standard.set(['he'], forKey: "AppleLanguages")
UserDefaults.standard.synchronize()
But it's work only after relaunch of the app.
So, how I can change the locale of days of the week on my locale without relaunch the app?
P.S. I tried to change locale in this way:
UserDefaults.standard.set(['he'], forKey: "AppleLanguages")
UserDefaults.standard.synchronize()
But it's work only after relaunch of the app.
So, how I can change the locale of days of the week on my locale without relaunch the app?
Thanks for feedback, I was sure it did work… As it is not possible to edit message, I duplicate the answer.
You can change localization on the fly without restarting (works only over iOS 13.)
You should do it by opening the app settings and let user select the language for the app:
You can change localization on the fly without restarting (works only over iOS 13.)
You should do it by opening the app settings and let user select the language for the app:
Code Block func openSettings() { guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { return } if UIApplication.shared.canOpenURL(settingsUrl) { UIApplication.shared.open(settingsUrl, completionHandler: nil) // { (success) in } }