Hi, I'm calling
UserDefaults.standard.setValue(["ru"], forKey: "AppleLanguages")
to change the app language with my GUI, and then I ask the user to restart the app so the change will take effect.
The problem is sometimes, after setting the AppleLanguages UserDefaults, and restarting the app, nothing changes, and the app Locale.current.identifier
stays the same.
Most of the time it works, but when it doesn't, I have to set the value and restart the app multiple times before it finally changes the language. I have no idea what the problem is related to since it appeared in one of the versions and nothing changed in the part of setting the language.
i've tried calling UserDefaults.standard.set
instead of UserDefaults.standard.setValue
, or calling synchronize()
, but nothing worked.
Any help will be appreciated.