mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-15 14:09:06 +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
|
#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)
|
if (found != string::npos)
|
||||||
system.locale.resize(found);
|
system.locale.resize(found);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (system.locale.empty())
|
if (system.locale.empty())
|
||||||
debugLog("could not establish system locale");
|
debugLog("could not establish system locale");
|
||||||
|
|
Loading…
Reference in a new issue