mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-12-24 21:55:42 +00:00
Fix possible crash on OSX introduced with localisation patch
This commit is contained in:
parent
c02ea1ce83
commit
99e3f5ebe2
1 changed files with 9 additions and 4 deletions
|
@ -614,12 +614,17 @@ void UserSettings::getSystemLocale()
|
|||
}
|
||||
}
|
||||
#else
|
||||
system.locale = getenv("LANG");
|
||||
// FIXME: Apparently this is not set when starting the game via the UI on OSX.
|
||||
const char *lang = (const char *)getenv("LANG");
|
||||
if (lang && *lang)
|
||||
{
|
||||
system.locale = lang;
|
||||
|
||||
size_t found = system.locale.find('.');
|
||||
size_t found = system.locale.find('.');
|
||||
|
||||
if (found != string::npos)
|
||||
system.locale.resize(found);
|
||||
if (found != string::npos)
|
||||
system.locale.resize(found);
|
||||
}
|
||||
#endif
|
||||
if (system.locale.empty())
|
||||
debugLog("could not establish system locale");
|
||||
|
|
Loading…
Reference in a new issue