diff -r 0e32e2110b42 code/ryzom/tools/client/client_patcher/main.cpp --- a/code/ryzom/tools/client/client_patcher/main.cpp Fri Mar 11 18:40:06 2011 +0100 +++ b/code/ryzom/tools/client/client_patcher/main.cpp Mon Mar 14 12:09:03 2011 +0100 @@ -183,7 +183,14 @@ // check if console supports utf-8 std::string lang = toLower(std::string(setlocale(LC_CTYPE, ""))); useUtf8 = (lang.find("utf8") != string::npos || lang.find("utf-8") != string::npos); - lang = lang.substr(0, 2); + // get language code (often it comes with country code too) + lang = lang.substr(0, lang.find('.')); + std::string country = ""; + if (lang.find('_') != string::npos) + { + country = lang.substr(lang.find('_') + 1); + lang = lang.substr(0, lang.find('_')); + } // check if console supports colors std::string term = toLower(std::string(getenv("TERM") ? getenv("TERM"):"")); @@ -263,6 +270,16 @@ #ifdef RYZOM_SHARE_PREFIX CPath::addSearchPath(RYZOM_SHARE_PREFIX"/patcher", true, false); #endif + // first try find translation with country code (if we have country code) + if ((!country.empty()) && (CPath::exists(lang + "_" + country + ".uxt"))) + { + lang = lang + "_" + country + ".uxt"; + } + // if translation file still not found, use English translation as a default + if (!CPath::exists(lang + ".uxt")) + { + lang = "en"; + } } // load translation