Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CFBundleLocalizations info.plist - How to put multiple languages

I cannot find the answer for this question anywhere. I'm new to Xcode. I have developed two multilanguage iPhone apps and cannot upload them to iTunes Connect because I'm getting the famous error "the value for the info.plist key cfbundlelocalizations is not of the required type for that key". Everybody says that it's because I need to put there an array of values, but I don't know how to do it. If I need for example, English and French, what should I to put there? Something like this (0=en, 1=fr)?

like image 562
Teofilo Israel Vizcaino Rodrig Avatar asked Dec 02 '11 00:12

Teofilo Israel Vizcaino Rodrig


People also ask

How do I translate Info plist?

To add languages, click on the blue Runner icon (on the left of the screen), then go to the Localizations section. There, you will just have to click on the + button. You should then see a new variant of the InfoPlist. strings appear, allowing you to do the translation.

How do you localize a string inside the iOS Info plist file?

You should use InfoPlist. strings file (keep both I & P capital) to localize values of Info. plist . To do this, go to File->New->File , choose Strings File under Resource tab of iOS , name it InfoPlist , and create.


1 Answers

The plist editor in Xcode seems to insist that it should be a string... if you want an array, try opening the plist file in a text editor, and adding this after a value:

    <key>CFBundleLocalizations</key>
    <array>
        <string>English</string>
        <string>French</string>
    </array>

so your plist would look like this:

...
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>     
    <key>CFBundleLocalizations</key>
    <array>
        <string>English</string>
        <string>French</string>
    </array>
...
like image 67
justin Avatar answered Oct 03 '22 21:10

justin