From 377ed0152a91262ef5177bdad3a6fc96b6737a1b Mon Sep 17 00:00:00 2001 From: Inky Date: Fri, 24 May 2019 03:34:56 +0300 Subject: [PATCH] Changed: check locale is supported under linux --HG-- branch : compatibility-develop --- code/nel/src/misc/i18n.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/nel/src/misc/i18n.cpp b/code/nel/src/misc/i18n.cpp index 3d617bef4..3dc3f4859 100644 --- a/code/nel/src/misc/i18n.cpp +++ b/code/nel/src/misc/i18n.cpp @@ -382,9 +382,15 @@ std::string CI18N::getSystemLanguageCode () } } #else - // only keep 2 first characters if (lang.size() > 1) - _SystemLanguageCode = NLMISC::toLower(lang).substr(0, 2); + { + // only keep 2 first characters + lang = NLMISC::toLower(lang).substr(0, 2); + + // language code supported? + if (isLanguageCodeSupported(lang)) + _SystemLanguageCode = lang; + } #endif } }