1

So i'm following the instructions on the apple site to localize my app name: http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html

I've created a InfoPlist.strings file for locales like en_GB.lproj etc... and set the CFBundleDisplayName appropriately.Everytime I build on the simulator using the appropriate locale I dont see the custom locale name on them. Does this only work for language like fr.lproj and not locales?

ArdenDev
  • 4,051
  • 5
  • 29
  • 50
  • 1
    Actually yes. If you want to localize bundle display name you'll have to create a localized version of 'project'-info.plist. Easiest way to do this is trough 'file inspector' clicking '+' on localization tab. – Rok Jarc Jul 25 '12 at 21:59
  • Thanks, if I try this the plist file gets moved into its own .lproj folder and I get a compiler error saying it can't find the base plist file. I tried looking through the project settings but can't determine where I need to set this locale specific path. Should I really try to set this? If I have multiple locales do I need to set everyone of them ? – ArdenDev Jul 27 '12 at 13:35

1 Answers1

0

This is how you do it with Xcode 6. Add languages you need at your Project (not Target) page. For a country-specific language like en-GB you select 'Other' and choose the language English (United Kingdom) from a long list.

This will create the following files in Supporting Files directory:

Info.plist - an XML file containing keys and default values

InfoPlist.strings - a directory containing localized files for each language you've chosen, e.g.

InfoPlist.strings (Base)
InfoPlist.strings (English)
InfoPlist.strings (English (United Kingdom))
InfoPlist.strings (French)

Right click on Info.plist and select "Open as Source". Add the following lines:

<key>CFBundleDisplayName</key>
<string>$(PRODUCT_NAME)</string>

(The actual folder names will be en.lproj, en-GB.lproj, fr.lproj, but to create them manually you probably need to do it in Finder and then drag to Xcode, since Xcode creates only "virtual" folders, not the real ones)

Open InfoPlist.strings for a language other than default (e.g French) and add the following line:

CFBundleDisplayName="Nom de l\'app en Française";

(Notice the semicolon at end, otherwise the build will fail). Rebuild your project.

cyanide
  • 3,885
  • 3
  • 25
  • 33