From 41c3d0cbe0593b50fcccd56e43921fb50720d565 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 : patches-from-atys --- 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 f61bcddf6..1a1db0f00 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 } }