mirror of https://github.com/OpenTTD/OpenTTD
(svn r10851) -Feature [OSX]: OpenTTD will now pick the same language as finder is set to if no config file is found (ln-)
parent
04824abac6
commit
1a5a748973
|
@ -158,3 +158,16 @@ void ShowMacErrorDialog(const char *error)
|
||||||
ShowMacDialog(error, buffer, "Quit");
|
ShowMacDialog(error, buffer, "Quit");
|
||||||
abort();
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -1237,7 +1237,8 @@ bool ReadLanguagePack(int lang_index)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Win32 implementation in win32.cpp. */
|
/* Win32 implementation in win32.cpp. */
|
||||||
#ifndef WIN32
|
/* OS X implementation in os/macosx/macos.mm. */
|
||||||
|
#if !(defined(WIN32) || defined(__APPLE__))
|
||||||
/** Determine the current charset based on the environment
|
/** Determine the current charset based on the environment
|
||||||
* First check some default values, after this one we passed ourselves
|
* First check some default values, after this one we passed ourselves
|
||||||
* and if none exist return the value for $LANG
|
* and if none exist return the value for $LANG
|
||||||
|
@ -1261,7 +1262,7 @@ const char *GetCurrentLocale(const char *param)
|
||||||
|
|
||||||
return getenv("LANG");
|
return getenv("LANG");
|
||||||
}
|
}
|
||||||
#endif /* ifndef WIN32 */
|
#endif /* !(defined(WIN32) || defined(__APPLE__)) */
|
||||||
|
|
||||||
static int CDECL LanguageCompareFunc(const void *a, const void *b)
|
static int CDECL LanguageCompareFunc(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue