It is a colossal problem for me that STextBlock has as its fundamental data type a FString
private:
/** The text displayed in this text block */
TAttribute< FString > Text;
Why is this so?
This means the fundamental Text datatype of Slate does not support Localization!
#RichText
SRichText does have correct fundamental datatype, but it does not have an easy accessor for me to change the FTextBlockStyle during runtime to allow for changing size and color of text dynamically.
Currently the localization support for STextBlock uses a ‘pass-through’ FText attribute to allow both localized and non-localized text to be displayed in the text block. The internal attribute is FString-based, for sure, but the attributes passed as arguments to the widget can be either FText or FString so the user of the widget can use localized text if they want to.
See the definition of SLATE_TEXT_ATTRIBUTE in DeclarativeSyntaxSupport.h to see how this works under the hood.
You’re correct, that should really be using FText so that it will automatically update the display string if the culture is changed, however the widget itself can still display localised text since the FString within the FText will still be localised based on whatever culture was active when the widget was created (assuming you passed in something from a LOCTEXT).
We’re aware that we have some widgets storing text as FString rather than FText, and we know that they need to be changed to use FText in order to take full advantage of our localisation system.
STextBlock has now been updated to use FText, which means that as of 4.5, STextBlock (and everything that nests it) will properly support live culture updates.