swift – IOS: AppleLanguages not taking impact after app restart (typically)

[ad_1]

I am calling UserDefaults.normal.setValue(["ru"], forKey: "AppleLanguages") to alter the app language with my GUI, after which I ask the consumer to restart the app so the change will take impact.

The issue is usually, after setting the AppleLanguages UserDefaults, and restarting the app, nothing modifications, and the app Locale.present.identifier,(and the entire app lang) stays the identical.

More often than not it really works, however when it would not, I’ve to set the worth and restart the app a number of instances earlier than it lastly modifications the language. I do not know what the issue is said to because it appeared in one of many variations and nothing modified within the a part of setting the language.

I’ve tried calling UserDefaults.normal.set as a substitute of UserDefaults.normal.setValue, or calling UserDefaults.normal.synchronize(), however nothing labored.

Any assist might be appreciated.

[ad_2]

Leave a Reply