Re: BundleDisplayName


Gerriet M. Denkmann
 

On 8 Jul 2017, at 20:06, Gerriet M. Denkmann <g@mdenkmann.de> wrote:

macOS 12.5, Xcode Version 8.3.2 (8E2002)

App with Base Internationalisation; Development Language = English, localised for German.

Target = “TargetName” (probably same as PRODUCT_NAME)

Both InfoPlist.strings (Base) and InfoPlist.strings (German) have:
CFBundleDisplayName = “RealName”;

Activity Monitor shows: “RealName”; as do both:
[NSBundle mainBundle].localizedInfoDictionary[@“CFBundleDisplayName”] and
[NSRunningApplication currentApplication].localizedName.

But Finder shows “TargetName” (if system language = English).

When I log in as a user with system language = German, Finder shows: “RealName” as it should.

I find this very confusing and not quite what I expected.

How can I persuade Finder to always use the value from InfoPlist.strings regardless of system language?
Finder (at least in macOS 12.5) seems to work like this:

When an app.bundle is copied into some folder (and only then), it reads TheApp.app/Contents/Resources/<system language>.lproj/InfoPlist.strings and uses the value of CFBundleDisplayName to display the app’s name.

It never reads Base.lproj, even if the system language = Localization native development region = CFBundleDevelopmentRegion

The problem is that Xcode (obviously unaware of this Finder peculiarity) does NOT allow English as an additional localisation (because the development region already is English; so English speaking computers should just use Base.lproj).

What can be done?

Gerriet.

Join cocoa@apple-dev.groups.io to automatically receive all group messages.