MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / SetLanguage

Method SetLanguage

engine/Poseidon/UI/Locale/Stringtable/Stringtable.cpp:503–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501#endif
502 }
503 return _registered[ids].value;
504}
505
506void StringTable::RelocalizeRegistered()
507{
508 for (int i = 0; i < _registered.Size(); i++)
509 {
510 const StringTableItem& fresh = _tableGlobal[_registered[i].name];
511 if (!_tableGlobal.IsNull(fresh))
512 {
513 _registered[i].value = fresh.value;
514 }
515 else
516 {
517 RptF("[i18n] key '%s' missing after language switch; keeping prior value",
518 (const char*)_registered[i].name);
519 }
520 }
521}
522
523void StringTable::ReloadAll()
524{
525 // Snapshot — Load() may append to _loaded and reallocate, invalidating references.
526 AutoArray<LoadedEntry> snapshot;
527 snapshot.Resize(_loaded.Size());
528 for (int i = 0; i < _loaded.Size(); i++)
529 {
530 snapshot[i] = _loaded[i];
531 }
532 for (int i = 0; i < snapshot.Size(); i++)

Callers 1

SetLanguageFunction · 0.45

Calls 3

stricmpFunction · 0.50
GetLengthMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected