FText
Class¶
The primary component for Localization in Unreal Engine. FText
s hold an internal "text history", enabling culture-based rebuilding of the text. All user-facing text should use this class. FText
instances can be defined with specialized literal macros:
HelloWorldText = LOCTEXT("HelloText","Hello, World!") // In current localization namespace
GoodbyeWorldText = NSLOCTEXT("OtherNamespace","GoodbyeText","Bye!") // or in another namespace
They can also be created from FString
s and FName
s:
HelloWorld = FText::FromString(HelloString);
GoodbyeWorld = FText::FromName(GoodbyeName);
FText
s support formatting ordered and named formatting via FText::Format
, similar to FString
s. However, they do not support any comparison operators. For more information, see the Localization section.