FText
- Module
- Core
- Header
#include "Core/Localization.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
FText() = default | FText | |
FText(std::string ns, std::string key, std::string source) : m_namespace(std::mo… | FText |
Public functions
| Returns | Name | Description |
|---|---|---|
std::string | ToString | |
std::string | ToStringPlural | The plural / select forms of this text's key, resolved against the active locale. |
std::string | ToStringSelect | |
const std::string& | GetNamespace | |
const std::string& | GetKey | |
const std::string& | GetSourceString | |
bool | IsEmpty | |
std::string | Format | Positional formatting: "{0}", "{1}", ... |
std::string | FormatArgs | UE's FText::Format, single pass, so text substituted for one argument is never searched for another (a player called "{1}" stays "{1}"): {0} {name} the argument's text {0}|plural(one=card,other=cards) CLDR cardinal of the argument's number {0}|ordinal(one=st,two=nd,few=rd,other=th) {0}|select(male=he,female=she,other=they) by the argument's text { `` a literal '{' and '' A form list may also key on an exact number: plural(=0=none,one=...). |
Function details
FText
FText() = defaultFText
FText(std::string ns, std::string key, std::string source) : m_namespace(std::move(ns)), m_key(std::move(key)), m_source(std::move(source))ToString
std::string ToString() constToStringPlural
std::string ToStringPlural(int64_t count) constThe plural / select forms of this text's key, resolved against the active locale. Both fall back to this text's source string.
ToStringSelect
std::string ToStringSelect(const std::string& form) constGetNamespace
const std::string& GetNamespace() constGetKey
const std::string& GetKey() constGetSourceString
const std::string& GetSourceString() constIsEmpty
bool IsEmpty() constFormat
static std::string Format(const std::string& pattern, const std::vector<std::string>& args)Positional formatting: "{0}", "{1}", ... replaced by args; indices without a matching arg are left verbatim.
FormatArgs
static std::string FormatArgs(const std::string& pattern, const std::vector<FFormatArgumentValue>& args, const std::string& locale)UE's FText::Format, single pass, so text substituted for one argument is never searched for another (a player called "{1}" stays "{1}"): {0} {name} the argument's text {0}|plural(one=card,other=cards) CLDR cardinal of the argument's number {0}|ordinal(one=st,two=nd,few=rd,other=th) {0}|select(male=he,female=she,other=they) by the argument's text { `` a literal '{' and '' A form list may also key on an exact number: plural(=0=none,one=...). An argument that does not exist leaves its placeholder verbatim.