MCPcopy Create free account
hub / github.com/JACoders/OpenJK / SE_LoadLanguage

Function SE_LoadLanguage

code/qcommon/stringed_ingame.cpp:1222–1257  ·  view source on GitHub ↗

returns error message else NULL for ok. Any errors that result from this should probably be treated as game-fatal, since an asset file is fuxored.

Source from the content-addressed store, hash-verified

1220// Any errors that result from this should probably be treated as game-fatal, since an asset file is fuxored.
1221//
1222const char *SE_LoadLanguage( const char *psLanguage, SE_BOOL bLoadDebug /* = SE_TRUE */ )
1223{
1224 const char *psErrorMessage = NULL;
1225
1226 if (psLanguage && psLanguage[0])
1227 {
1228 SE_NewLanguage();
1229
1230 std::string strResults;
1231 /*int iFilesFound = */SE_BuildFileList(
1232 #ifdef _STRINGED
1233 va("C:\\Source\\Tools\\StringEd\\test_data\\%s",sSE_STRINGS_DIR)
1234 #else
1235 sSE_STRINGS_DIR
1236 #endif
1237 , strResults
1238 );
1239
1240 const char *p;
1241 while ( (p=SE_GetFoundFile (strResults)) != NULL && !psErrorMessage )
1242 {
1243 const char *psThisLang = TheStringPackage.ExtractLanguageFromPath( p );
1244
1245 if ( !Q_stricmp( psLanguage, psThisLang ) )
1246 {
1247 psErrorMessage = SE_Load( p, bLoadDebug );
1248 }
1249 }
1250 }
1251 else
1252 {
1253 __ASSERT( 0 && "SE_LoadLanguage(): Bad language name!" );
1254 }
1255
1256 return psErrorMessage;
1257}
1258
1259
1260// called in Com_Frame, so don't take up any time! (can also be called during dedicated)

Callers 2

SE_InitFunction · 0.70

Calls 6

Q_stricmpFunction · 0.85
SE_NewLanguageFunction · 0.70
vaFunction · 0.70
SE_GetFoundFileFunction · 0.70
SE_LoadFunction · 0.70

Tested by

no test coverage detected