[DEBUG] correct throw of the Windows port of get language

This commit is contained in:
Edouard DUPIN 2016-10-13 22:04:31 +02:00
parent 9e9b8e0e02
commit b451e97293

View File

@ -239,14 +239,22 @@ const std::string& ewol::translate::getLanguage() {
void ewol::translate::autoDetectLanguage() { void ewol::translate::autoDetectLanguage() {
EWOL_VERBOSE("Auto-detect language of system"); EWOL_VERBOSE("Auto-detect language of system");
std::string nonameLocalName = std::locale(std::locale(), new std::ctype<char>).name(); std::string nonameLocalName;
std::string userLocalName = std::locale("").name(); std::string userLocalName;
std::string globalLocalName = std::locale().name(); std::string globalLocalName;
try {
EWOL_VERBOSE(" The default locale is '" << globalLocalName << "'"); nonameLocalName = std::locale(std::locale(), new std::ctype<char>).name();
EWOL_VERBOSE(" The user's locale is '" << userLocalName << "'"); userLocalName = std::locale("").name();
EWOL_VERBOSE(" A nameless locale is '" << nonameLocalName << "'"); globalLocalName = std::locale().name();
EWOL_VERBOSE(" The default locale is '" << globalLocalName << "'");
EWOL_VERBOSE(" The user's locale is '" << userLocalName << "'");
EWOL_VERBOSE(" A nameless locale is '" << nonameLocalName << "'");
} catch (std::runtime_error e) {
EWOL_ERROR("Can not get Locals ==> set English ...");
nonameLocalName = "EN";
userLocalName = "EN";
globalLocalName = "EN";
}
std::string lang = nonameLocalName; std::string lang = nonameLocalName;
if ( lang == "*" if ( lang == "*"
|| lang == "") { || lang == "") {