Detect language in use by iOS application

后端 未结 2 837
野性不改
野性不改 2021-01-21 13:47

How can I detect the current application language ? I am not talking about NSLocale user preferences.

In my app there are currently two supported languages

2条回答
  •  后悔当初
    2021-01-21 14:54

    I usually reserve a special key in Localizable.strings, such as "HTTPAcceptLanguage", which I set to "en", "fr", etc. Now telling your server the language displayed by the application is as simple as NSLocalizedString(@"HTTPAcceptLanguage", nil).

提交回复
热议问题