4

I was researching a problem with the Notification Center and noticed that Finder shows the program as Notification Center, yet on disk and in the package receipts and installation media, the file is actually NotificationCenter.app (And the full path to is is /System/Library/CoreServices/NotificationCenter.app)

Notification Center - with and without a space

I understand how Finder drops the .app extension by default, but where does the system know to add the space in this app's name?

  • Not at my Mac right now so I can't confirm but wouldn't it be listed in the plist inside the bundle? – tubedogg Sep 3 '13 at 18:20
  • @tubedogg I checked there - no spaces at all in any text plist file I have installed on this Mac. What's odd is the code signing also signs the name without a space (both in the .app and the final Contents/MacOS portion, so I'm guessing it's a Finder oddity at this point.) – bmike Sep 3 '13 at 18:27
8

That's handled by localization.

If you check the Info.plist, there's a key LSHasLocalizedDisplayName with a value of true. That means that there are localized names for the application. Localizations are stored in the app bundle in Contents/Resources. Since I'm using English, I can look in /System/Library/CoreServices/NotificationCenter.app/Contents/Resources/en.lproj/InfoPlist.strings, and see the name of the app with the space in it.

Strings files are actually binary plists. You can view them in a human-readable fashion with

$ plutil -p /System/Library/CoreServices/NotificationCenter.app/Contents/Resources/en.lproj/InfoPlist.strings
{
  "CFBundleDisplayName" => "Notification Center"
  "CFBundleName" => "Notification Center"
}
  • Since that file is stored in a binary format, might you expand on how you "see" the name there if you didn't just extract random strings from the file as I edited in above? Bonus points for a command line tool that dumps the correct localization directory for a certain locale. – bmike Sep 3 '13 at 18:42
  • Hmmmm... Still trying to find a way to find the right directory, since dialect-specific directories make it a bit more complicated. – Alan Shutko Sep 3 '13 at 18:54
  • That's really a separate question if we don't get a quick "next step - here's the deeper mechanism" behind localization. That it's localized is 90% of the battle here. – bmike Sep 3 '13 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .