On this page
  1. Text
  2. key, context, translated, args
  3. str
  4. id

rmp::Text

class #include <rmp/text.h> include/rmp/text.h:82
class Text

A text the framework draws: translated when it was a literal, as it is when it was made at runtime.

Text

template <std::size_t N> // NOLINTNEXTLINE(google-explicit-const
template <class S> requires(std::convertible_to<const S &, std::string_view> && !std::is_array_v<S>) Text(const S &runtime) // NOLINT(google-explicit-constructor): every string is a Text
Text(std::string_view key, const TextOptions &options)
Text(std::string_view key, std::initializer_list<TextArg> args, const TextOptions &options = {})

A literal: translated, and the key is its own words. A reference to the array, so a literal and a runtime string are told apart by their type.

key, context, translated, args

std::string_view key() const
std::string_view context() const
bool translated() const
std::span<const TextArg> args() const

What the tables are looked up by: the text as the code wrote it.

str

std::string str() const

The text to show: translated into the current language, its plural form chosen and its placeholders filled.

id

std::string id() const

The identity a widget keeps across languages: the key and its context, never the translation — so focus and hover survive rmp::lang::set().