cl_main: set language according to LANG variable

This commit is contained in:
nillerusr
2022-02-06 03:48:40 +03:00
parent c36cfccdf0
commit 9dd2d20e78
2 changed files with 27 additions and 4 deletions
+8 -3
View File
@@ -72,6 +72,7 @@
#include "replay_internal.h"
#endif
#include "language.h"
#include "igame.h"
// memdbgon must be the last include file in a .cpp file!!!
@@ -2743,14 +2744,18 @@ void CL_InitLanguageCvar()
}
else
{
char *szLang = getenv("LANG");
if ( CommandLine()->CheckParm( "-language" ) )
{
cl_language.SetValue( CommandLine()->ParmValue( "-language", "english") );
else if( szLang )
{
ELanguage lang = PchLanguageICUCodeToELanguage(szLang, k_Lang_English);
char *szShortLang = GetLanguageShortName(lang);
cl_language.SetValue( szShortLang );
}
else
{
cl_language.SetValue( "english" );
}
}
}