How to set default localization for iOS app

后端 未结 6 1090
孤城傲影
孤城傲影 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:09

    You probably need to set Russian as a value of CFBundleDevelopmentRegion in the Info.plist.

    CFBundleDevelopmentRegion (String - iOS, OS X) specifies the native region for the bundle. This key contains a string value that usually corresponds to the native language of the person who wrote the bundle. The language specified by this value is used as the default language if a resource cannot be located for the user’s preferred region or language.

    Update

    If you really want and need to override the language priority of the OS, you could use AppleLanguages user defaults key (although, as you know, it is not recommended):

    [[NSUserDefaults standardUserDefaults] setObject:@[@“ru”, @“en”] forKey:@“AppleLanguages”];
    

提交回复
热议问题