本地化app名字

How to Localize App Names


It is possible to localize app names directly within Xcode and you do not need to create multiple versions of the same app.

 

The great and wonderful InfoPlist.strings

You will need to localize the CFBundleDisplayName key contained in your app’s Info.plist file. To do this, we’ll have to create an InfoPlist.strings file which will be cross checked with the system language when an app is displayed on an iOS or Mac OS device.

Here’s what Apple have to say:

CFBundleDisplayName (String – iOS, Mac OS X) specifies the display name of the bundle. If you support localized names for your bundle, include this key in both your information property list file and in the InfoPlist.strings files of your language subdirectories. If you localize this key, you should also include a localized version of the CFBundleName key.

If you do not intend to localize your bundle, do not include this key in your Info.plist file. Inclusion of this key does not affect the display of the bundle name but does incur a performance penalty to search for localized versions of this key.

Step-by-Step Guide to localizing your app name

  1. Open your Xcode project
  2. Choose File > New > New File… and add a new String file (under Resources).
  3. Name string file: InfoPlist.strings and add it to the correct target
  4. Now navigate to your target’s Info.plist 
  5. In most cases you will need to add the following key and set it to true: Application has localised display name | Boolean | YES
  6. If present, remove the key: Bundle display name.
  7. Now navigate to your new InfoPlist.strings file you created and add the required localizations
  8. Now in the English InfoPlist.strings file, type the following:
    CFBundleDisplayName = “Application Name in English”;
    CFBundleName = “App Name – in English”;
  9. Repeat step 8 in the localized InfoPlist.strings file. E.g. German:
    CFBundleDisplayName = “Application Name in German”;
    CFBundleName = “App Name – in German;

That’s it! Build your app and change your OS language (iOS or OS X) and you will see the localised app name.

 

Think first (Sales & Marketing)

There’s only one caveat when localizing app names: always ask yourself if you want to be creating separate brands in individual countries before proceeding. If you don’t have a specific brand name, such a “Torch” app or “Tip Calculator” then we would certainly recommend localising app names.

原文链接:https://kb.applingua.com/2011/10/how-to-localize-app-names/

你可能感兴趣的:(ios,Objective-C,Swift)