iOS: How to Get the Device Current Language Setting?

后端 未结 10 1273
北荒
北荒 2021-02-01 05:10

There are some features within my application that are supposed to be based on the language settings of the device where it\'s running.

I want to get the actual language

10条回答
  •  爱一瞬间的悲伤
    2021-02-01 05:47

    Getting language and region in Swift:

        LF.log("language", NSLocale.preferredLanguages())
        LF.log("locale", NSBundle.mainBundle().preferredLocalizations)
    

    In my case I'm getting:

    language: '(
        "zh-Hans"
    )'
    locale: '(
        en
    )'
    

提交回复
热议问题