How to set default localization for iOS app

后端 未结 6 1028
孤城傲影
孤城傲影 2021-02-07 01:51

I\'m developing app for Russian-speaking people. A lot of countries near Russia have the second language - Russian. My app has two localizations: Russian and English. And I need

6条回答
  •  野性不改
    2021-02-07 02:03

    In my case I have only Russian localization with hard-coded strings in my app, but I use libraries with localization bundles. Strings from libraries were in English by default. Because NSBundle.mainBundle.preferredLanguages were [ "en" ].

    They became Russian after I specified app localization language in Info.plist with CFBundleLocalizations key:

    CFBundleLocalizations (Array - iOS, OS X) identifies the localizations handled manually by your app. If your executable is unbundled or does not use the existing bundle localization mechanism, you can include this key to specify the localizations your app does handle.

    Each entry in this property’s array is a string identifying the language name or ISO language designator of the supported localization. See “Language and Locale Designations” in Internationalization and Localization Guide in Internationalization Documentation for information on how to specify language designators.

提交回复
热议问题