简体   繁体   中英

Xcode shows limited language list in Info.plist Localizations settings

My project is created with Cordova and imported to Xcode 8.1.

I am attempting to localize the camera and photo roll permission reason values in Info.plist. The languages I am supporting are English and Swedish. I have a file called InfoPlist.strings, which has an English and a Swedish translation:

InfoPlist.strings showing English and Swedish translation files

屏幕截图

Some descriptions of the process for this also specify that I should add an entry to the Info.plist file called "Localizations", with the languages I want to support as entries. However, Xcode doesn't give Swedish an option when I attempt to do this:

List of localization options showing a short list of possible languages

屏幕截图

Currently, the localization does not work. The value presented to the user is in English regardless of the devices language settings:

屏幕截图

How can I add Swedish to the list of supported localizations in the Info.plist file? Is there anything else do I need to do to make sure these strings will localize correctly?

You can just edit the info.plist file with your favourite text editor:

<key>CFBundleLocalizations</key>
<array>
    <string>en</string>
    <string>sv</string>
    <string>es</string>
    <string>fr</string>
</array>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM