How can I change the locale for my app programmatically via Swift?

daaniaal

I have a language selection control in my application, and I want to be able to set the locale accordingly during runtime. How can I achieve this?

daaniaal

I found the answer

NSUserDefaults.standardUserDefaults().setObject(["fr"], forKey: "AppleLanguages")
NSUserDefaults.standardUserDefaults().synchronize()

Swift 3:

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How would I reference the main storyboard in my app programmatically in swift?

From Dev

Can I change the properties of all the buttons in my Swift app?

From Dev

how can i make my iphone app to Supporting Multiple iOS Versions and Devices in swift programmatically using device screen size

From Dev

How can I change the locale on the Xcode Playground

From Dev

How can I change my seller name In App Store?

From Dev

How can I change the activity that started with my android app?

From Dev

How Can I change the title of my java app on the osx menubar?

From Dev

How can I change the activity that started with my android app?

From Dev

Flutter: How can I change the Alignment of a Text in a Textfield programmatically via buttons?

From Dev

How can I change ImageButton size programmatically?

From Dev

How can I change shape color programmatically?

From Dev

How can I change the height of an UIImageView programmatically?

From Dev

How to change locale of another app?

From Dev

How can I change Spring locale cookie name?

From Dev

How can I mount an ISO via PowerShell/programmatically?

From Dev

How can i change the backgroundcolor via jquery?

From Dev

DateTime locale string not change even I changed the locale in app in android

From Dev

How can I receive files on ubuntu via dukto app from my Android device

From Dev

How to change app:elevation programmatically

From Dev

How to change app:elevation programmatically

From Dev

How can i programmatically change magento media storage?

From Dev

How can I change the global tint color programmatically?

From Dev

How can I programmatically change file encoding linux?

From Dev

Spritebuilder how can I change the animation ( CCB file ) of a CCNode programmatically?

From Dev

How can I change COM Security settings programmatically by c#?

From Dev

How can I programmatically change a file's icon?

From Dev

How can I change the summary text color of a Preference programmatically?

From Dev

How can i programmatically change magento media storage?

From Dev

How can I change COM Security settings programmatically by c#?

Related Related

  1. 1

    How would I reference the main storyboard in my app programmatically in swift?

  2. 2

    Can I change the properties of all the buttons in my Swift app?

  3. 3

    how can i make my iphone app to Supporting Multiple iOS Versions and Devices in swift programmatically using device screen size

  4. 4

    How can I change the locale on the Xcode Playground

  5. 5

    How can I change my seller name In App Store?

  6. 6

    How can I change the activity that started with my android app?

  7. 7

    How Can I change the title of my java app on the osx menubar?

  8. 8

    How can I change the activity that started with my android app?

  9. 9

    Flutter: How can I change the Alignment of a Text in a Textfield programmatically via buttons?

  10. 10

    How can I change ImageButton size programmatically?

  11. 11

    How can I change shape color programmatically?

  12. 12

    How can I change the height of an UIImageView programmatically?

  13. 13

    How to change locale of another app?

  14. 14

    How can I change Spring locale cookie name?

  15. 15

    How can I mount an ISO via PowerShell/programmatically?

  16. 16

    How can i change the backgroundcolor via jquery?

  17. 17

    DateTime locale string not change even I changed the locale in app in android

  18. 18

    How can I receive files on ubuntu via dukto app from my Android device

  19. 19

    How to change app:elevation programmatically

  20. 20

    How to change app:elevation programmatically

  21. 21

    How can i programmatically change magento media storage?

  22. 22

    How can I change the global tint color programmatically?

  23. 23

    How can I programmatically change file encoding linux?

  24. 24

    Spritebuilder how can I change the animation ( CCB file ) of a CCNode programmatically?

  25. 25

    How can I change COM Security settings programmatically by c#?

  26. 26

    How can I programmatically change a file's icon?

  27. 27

    How can I change the summary text color of a Preference programmatically?

  28. 28

    How can i programmatically change magento media storage?

  29. 29

    How can I change COM Security settings programmatically by c#?

HotTag

Archive