Swift : How to change language inside app?

前端 未结 6 1643
忘了有多久
忘了有多久 2020-12-31 19:31

i am using Localize-Swift library (Link) to localize my application and it works fine with .strings files. the problem is that i have to localize to a language

6条回答
  •  盖世英雄少女心
    2020-12-31 20:08

    1. Requires restart of app. Follow below lines of code.

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

    2. Restart of app not requires ( the answer may requires customization in provided source code). Follow the provided web link.

    http://www.factorialcomplexity.com/blog/2015/01/28/how-to-change-localization-internally-in-your-ios-application.html

提交回复
热议问题