MacOS – By what mechanism does finder insert a space in an app’s name

findermacos

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?

Best Answer

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"
}