From a5f52ac5a811c2730cbb3316495ca3bc8a86475e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 22 Feb 2014 17:32:18 -0800 Subject: [PATCH] Fixed bug 2395 - OSX: App name in the menu bar is not localized. 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; } --- src/video/cocoa/SDL_cocoaevents.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m index b3a6e93fa..a219e29ac 100644 --- a/src/video/cocoa/SDL_cocoaevents.m +++ b/src/video/cocoa/SDL_cocoaevents.m @@ -125,13 +125,12 @@ static SDLAppDelegate *appDelegate = nil; 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];