Giter Site home page Giter Site logo

Comments (4)

nicklockwood avatar nicklockwood commented on July 17, 2024

Apparently the CFBundleDisplayName isn't always defined and doesn't always work, and oddly there's no constant for it, which seems a bit odd.

Any idea where I can find a definitive Apple document stating which I should use under which circumstances?

from irate.

4marcus avatar 4marcus commented on July 17, 2024

I found this document: http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPInternational/Articles/LocalizingPathnames.html#//apple_ref/doc/uid/20002141-97582-BCIDCGHG

Localizing Your Application Name

If you have a bundled application, you can specify a localized display name for your application. The Finder displays localized bundle names based on the current language settings. Other applications can request your application’s localized name as well and display it as appropriate.

Note: Mac OS X does not support localized names for non-bundled applications.
You specify localized names for your application using the existing bundle localization mechanism. The Resources folder of your application bundle contains one or more language-specific resource directories. (See “Bundle Structures” in Bundle Programming Guide for information about bundle resource directories.) In each of these language-specific directories, you can include an InfoPlist.strings file with a list of localized property-list keys. One of the keys you can include in this file is the CFBundleDisplayName key, whose value you can set to the localized name of your bundle.

At all times, Mac OS X prefers user-customized display names over the default and localized names you specify in your bundle. If the on-disk application name is different than the non-localized version of your bundle display name—that is, the name associated with the CFBundleDisplayName key in your Info.plist file—the system assumes the user made the change and returns the customized name. If at some later time, the user changes the application name back to the original name, the system reverts to using the localized values from your application bundle.

Important: If you want your localized display names to appear, you must include the LSHasLocalizedDisplayName key in your application’s Info.plist file, set the type of its value to Boolean, and set the value to true. The functions that access localized display name information check for the existence of this key before retrieving the information.

Probably checking LSHasLocalizedDisplayName for YES is an option before querying the BundleDisplayName. Or check if nil/empty and fall back to the BundleName.

from irate.

nicklockwood avatar nicklockwood commented on July 17, 2024

I guess using BundleDisplayName and then falling back to BundleName if it's nil should be safe enough. I'll look at incorporating that in the next build.

from irate.

nicklockwood avatar nicklockwood commented on July 17, 2024

Fixed in version 1.2.3

from irate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.