TnxStringTable class
#include <Runtime/UI/Public/TnxStringTable.h>
The string files of every folder added, as the table of one language.
Folders can be added from any thread; Pump and Use run where documents update (the host does both).
Public types
- struct LanguageInfo
- A language there are files for.
Public static functions
- static auto EngineEnglish() -> std::string_view
- The engine's English, compiled in from Trinyx/assets/strings/en.strings.
-
static void Parse(std::string_view text,
std::string_view where,
GGUI::
GGStringTable& into, std::vector<std::string>* problems) - Read
textas a strings file intointo. Bad lines are added toproblemsas "where(line): text".
Constructors, destructors, conversion operators
- TnxStringTable()
- English, from the engine's compiled-in strings, until folders are added and pumped.
Public functions
- void AddFolder(std::string_view directory)
- Read
<language>.stringsfiles fromdirectory, after the folders added before it. - auto Use(std::string_view language) -> bool
- Show
language, with English under it. False if no folder has it (English is shown). - auto Language() const -> std::string_view
- The language shown: its code (
en,de). - auto Languages() -> std::vector<LanguageInfo>
- The languages there are files for, English first.
- auto Pump(bool bWatch) -> bool
- Read folders added since the last pump, and with
bWatch, files saved since they were read; rebuild the table if anything changed. True if Table() changed. -
auto Table() const -> const GGUI::
GGStringTable* - The table to show. Valid until the second Pump or Use after this one that changes it.
- auto Problems() const -> const std::vector<std::string>&
- Lines that weren't
ID = text, as "path(line): text". Pumping thread only.