Localization in Swift - Restrict app to one language even if the app has more languages

前端 未结 3 582
慢半拍i
慢半拍i 2020-12-18 09:02

I have developed an app in Swift 3.2 which is currently live with base language English. I have added String files for Arabic and French. But till the time everything in co

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-18 09:55

    Added below code to AppDelegate in didFinishLaunchingWithOptions First line to force app left to right. Then in Edit Scheme - Added an Argument on Launch -AppleLanguages (Base). Working quite well for me to force user to English.

    UIView.appearance().semanticContentAttribute = .forceLeftToRight
        UserDefaults.standard.set(["Base"], forKey: "AppleLanguages")
        UserDefaults.standard.synchronize()
    

提交回复
热议问题