mirror of https://github.com/encounter/SDL.git
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; }
This commit is contained in:
parent
eb5eb04652
commit
a5f52ac5a8
|
@ -125,13 +125,12 @@ static SDLAppDelegate *appDelegate = nil;
|
||||||
static NSString *
|
static NSString *
|
||||||
GetApplicationName(void)
|
GetApplicationName(void)
|
||||||
{
|
{
|
||||||
NSDictionary *dict;
|
NSString *appName;
|
||||||
NSString *appName = 0;
|
|
||||||
|
|
||||||
/* Determine the application name */
|
/* Determine the application name */
|
||||||
dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
|
appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
|
||||||
if (dict)
|
if (!appName)
|
||||||
appName = [dict objectForKey: @"CFBundleName"];
|
appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
|
||||||
|
|
||||||
if (![appName length])
|
if (![appName length])
|
||||||
appName = [[NSProcessInfo processInfo] processName];
|
appName = [[NSProcessInfo processInfo] processName];
|
||||||
|
|
Loading…
Reference in New Issue