I want to initialize FText from variables. The NSLOCTEXT() macro only allows string literals.
FName identifier = TEXT("MyIdentifier");
// Does not work for obvious reasons:
FText ident = NSLOCTEXT("MyNamespace", "MyKey", *identifier.ToString());
// Though the content is set, no namespace/keys are set:
FText ident = FText::Format(NSLOCTEXT("MyNamespace", "MyKey", "{0}"), FText::FromName(identifier));
For now I’m using the method of the NSLOCTEXT() macro
FText ident = FInternationalization::ForUseOnlyByLocMacroAndGraphNodeTextLiterals_CreateText(*identifier.ToString(), TEXT("MyNamespace"), *identifier.ToString());
which works, but as the method name already says, it is not intended for such usage.
Are there other macros/methods available to initialize FText with variables instead of literals?