Localize App Name?

Discussion in 'Mac Programming' started by Darkroom, Aug 5, 2008.

  1. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    i just started learning localization, so i'm fairly new... one thing i can't figure out is how to localize the name of the app.

    i can localize strings by doing something like this:

    Code:
    static NSString * CONSTwelcome;
    
    -(void)awakeFromNib
    {
    CONSTwelcome = NSLocalizedString (@"Welcome!", nil);
    //bla bla bla
    }
    
    and then of course i have a Localizable.Strings file with language-specific "subfiles"(?) in the app's resources... so is there someway to do the same with the name of the app?

    and while i'm on the subject, what is the point of IB allowing users to change the app's title in the menu bar object if it's not going to stick? it's kinda frustrating... wouldn't it be easier if apple made localizing the app's name just as easy in the .nib as changing all the other menu items? :mad:
     
  2. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #3
    i managed to make this work using this link you sent me... but the documentation is not clear... this is how i got it to work:

    Info.plist
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>CFBundleDevelopmentRegion</key>
    	<string>English</string>
    	<key>CFBundleExecutable</key>
    	<string>${EXECUTABLE_NAME}</string>
    	<key>CFBundleIconFile</key>
    	<string></string>
    	<key>CFBundleIdentifier</key>
    	<string>com.yourcompany.EnglishApp</string>
    	<key>CFBundleInfoDictionaryVersion</key>
    	<string>6.0</string>
    	<key>CFBundleName</key>
    	<string>${PRODUCT_NAME}</string>
    	<key>CFBundlePackageType</key>
    	<string>APPL</string>
    	<key>CFBundleSignature</key>
    	<string>????</string>
    	<key>CFBundleVersion</key>
    	<string>1.0</string>
    	<key>NSMainNibFile</key>
    	<string>MainMenu</string>
    	<key>NSPrincipalClass</key>
    	<string>NSApplication</string>
    	
    	<key>LSHasLocalizedDisplayName</key>
    	<true/>
    
    </dict>
    </plist>
    
    InfoPlist.strings - English
    Code:
    /* Localized versions of Info.plist keys */
    
    NSHumanReadableCopyright = "© __MyCompanyName__, 2008";
    CFBundleName = "English MenuBar"; //...and Finder's QuickLook
    CFBundleDisplayName = "EnglishApp";
    
    InfoPlist.strings - French
    Code:
    /* Localized versions of Info.plist keys */
    
    NSHumanReadableCopyright = "© __MyCompanyName__, 2008";
    CFBundleName = "French MenuBar"; //...and Finder's QuickLook
    CFBundleDisplayName = "FrenchApp";
    
    but now i've noticed that localization doesn't seem to work for the application label in the dock? is there a way to make it work? honest to god, could this process be any more arbitrary?
     
  3. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #4
    oh... i had to logout/restart... simply relaunching the finder wasn't cutting it for the dock's label... works now...
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    Well why would it be? The Dock and the Finder are different processes. If you'd relaunched the Dock (open the Terminal and type killall Dock) it would almost certainly have worked...
     
  5. alaceo macrumors member

    Joined:
    Feb 21, 2008
    #6
    Just curious, isn't localizing the application name frowned upon? It identifies your application and really doesn't seem like it should have multiple aliases. Same as how wouldn't localize a name when visiting or moving to another country (i.e. Michael Black wouldn't become Miguel Negro in Mexico).
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #7
    I think Apple localise some names and not others! For example (from memory) Address Book.app gets localised, but names that are distinct product names like Aperture don't. If I was developing a third-party app I'd not be localising the name as it would dilute the brand...
     
  7. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #8
    There are two different things: The actual, real name of a thing and the "display name". For example, the real name of your music and pictures folder is always "Music" and "Pictures", no matter what language the OS is set to. However, the displayed name can be different, for example "Musik" and "Bilder". (The display name is used for other purposes as well. When the user switches whether or not to display filename extensions, the display name changes, but the real name doesn't). Localising the real name will lead to trouble for your software. It would be no good if iTunes couldn't find its music after a changed MacOS X from French to Swedish. Localising the display name is fine.

    Obviously you want to use some common sense. I would probably not localise the name of "Safari", but I would localise the "Utility" part of "Airport Utility".
     

Share This Page