Skip to content

Commit

Permalink
Fixed bug 2395 - OSX: App name in the menu bar is not localized.
Browse files Browse the repository at this point in the history
Tim McDaniel

On OSX, the app name in the menu bar is not localized.  This can be fixed using the following implementation for GetApplicationName in SDL_cocoaevents.m:

static NSString *
GetApplicationName(void)
{
    NSDictionary *dict;
    NSString *appName = 0;

    appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
    if (!appName)
        appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];

    if (![appName length])
        appName = [[NSProcessInfo processInfo] processName];

    return appName;
}
  • Loading branch information
slouken committed Feb 23, 2014
1 parent eb5eb04 commit a5f52ac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/video/cocoa/SDL_cocoaevents.m
Expand Up @@ -125,13 +125,12 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam
static NSString *
GetApplicationName(void)
{
NSDictionary *dict;
NSString *appName = 0;
NSString *appName;

/* Determine the application name */
dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
if (dict)
appName = [dict objectForKey: @"CFBundleName"];
appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
if (!appName)
appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];

if (![appName length])
appName = [[NSProcessInfo processInfo] processName];
Expand Down

0 comments on commit a5f52ac

Please sign in to comment.