GGUI::GGStringTable class

One language. Not thread-safe: fill it before use, and change a table that is in use only on the thread that updates its documents.

Public static functions

static auto Defaults() -> GGStringTable&
Source-language text for string IDs: the fallback under every active table.

Public functions

void Set(std::string_view key, std::string_view text)
Show text for key.
auto Find(std::string_view key) const -> const std::string*
The text for key; null if there is no translation (the key is shown as written).
void Clear()
Remove every entry.
auto Count() const -> size_t
How many entries it has.
auto Revision() const -> uint64_t
Bumped on every change; documents re-resolve their text when it moves.

Function documentation

static GGStringTable& GGUI::GGStringTable::Defaults()

Source-language text for string IDs: the fallback under every active table.

Holds the library's own strings. Add yours at startup, before any document updates; it is read without a lock.