Skip to content

FText Class

FText

The primary component for Localization in Unreal Engine. FTexts 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 FStrings and FNames:

HelloWorld = FText::FromString(HelloString);
GoodbyeWorld = FText::FromName(GoodbyeName);

FTexts support formatting ordered and named formatting via FText::Format, similar to FStrings. However, they do not support any comparison operators. For more information, see the Localization section.