(svn r10851) -Feature [OSX]: OpenTTD will now pick the same language as finder is set to if no config file is found (ln-)

This commit is contained in:
bjarni
2007-08-11 15:52:34 +00:00
parent 76ab8ab86c
commit 8c5d47d510
2 changed files with 16 additions and 2 deletions

View File

@@ -158,3 +158,16 @@ void ShowMacErrorDialog(const char *error)
ShowMacDialog(error, buffer, "Quit");
abort();
}
/** Determine the current user's locale. */
const char *GetCurrentLocale(const char *)
{
static char retbuf[32] = { '\0' };
NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];
NSArray* languages = [defs objectForKey:@"AppleLanguages"];
NSString* preferredLang = [languages objectAtIndex:0];
/* preferredLang is either 2 or 5 characters long ("xx" or "xx_YY"). */
strncpy(retbuf, [preferredLang cString], 31);
return retbuf;
}