engine: fix audio language setting

This commit is contained in:
nillerusr
2022-09-10 03:30:28 +03:00
parent 09924b7998
commit 5912845f29
2 changed files with 20 additions and 3 deletions

View File

@@ -900,11 +900,20 @@ void COM_InitFilesystem( const char *pFullModPath )
}
else
{
char *szLang = getenv("LANG");
// still allow command line override even when not running steam
if (CommandLine()->CheckParm("-audiolanguage"))
{
Q_strncpy(language, CommandLine()->ParmValue("-audiolanguage", "english"), sizeof( language ) - 1);
}
else if( szLang )
{
ELanguage lang = PchLanguageICUCodeToELanguage(szLang, k_Lang_English);
const char *szShortLang = GetLanguageShortName(lang);
if( Q_strncmp(szShortLang, "none", 4) != 0 )
Q_strncpy(language, szShortLang, sizeof( language ) - 1);
}
}
if ( ( Q_strlen(language) > 0 ) && ( Q_stricmp(language, "english") ) )