1

i am making application in swift i want to make in two language. and i allready create two language file. but now i want to put two button on starting of application and if user click button 1 it will load english language and if user click button 2 it will load other language so how can i load language file.

allready tried : allready created two language file only want to know how to load them manually

Govind Rakholiya
  • 295
  • 1
  • 3
  • 20

2 Answers2

0

You can do that yourself. Only the user can change the language he use in his device setting.

Why do you thing a user want to use your application in a different language he use for his device ?

Sébastien REMY
  • 2,399
  • 21
  • 39
0

This worked using Swift 2.2 on iOS 9:

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

Then you can use NSLocalizedString normally, and the system language will be overridden by what was set at ["fr"] (French in this case). An app restart is required however for changes to take effect.

Source: How to force NSLocalizedString to use a specific language

Community
  • 1
  • 1
Jeremy Rea
  • 454
  • 1
  • 11
  • 21