Is it not possible to get the display name from an enum? I’m trying to use the enumerator as a place to store values about the character, Hair Color, Eye Color etc. and then I want to simply get the chosen value and display it to a widget but it seems that it’s not possible to get the display name from an enum which is really weird.
Ahh that’s what happened. I tried to plug it directly into the Text portion of my widget and it gave an incompatible error. Converting to string and then to text fixed the issue. Thank you
This is an old post but maybe it will help someone in the same situation.
When it comes to localization using ToString from an enum is of no help.
In the localization Dashboard there is an option to import Meta Data of Type Enum (from your C++ Code), however this is working in Editor only.
So the only viable option is to create a mapping between your Enums and a FText stored in a DataTable.
1 - For example you have a an Enum EClassType, which contains UMETA(DisplayName = “Warrior”) and UMETA(DisplayName = “Mage”).
2 - Create a Struct in Blueprint, name it S_DisplayName, the struct will contain a FText LocName.
3 - Now create a new Data Table, DT_ClassTypeNames based on the struct S_DisplayName.
As row name set the value to match the DisplayName set in your Enum (UMETA ).
As LocName set the name you want to be translated.
4 - Now in your UMG (or wherever you need to get the translated version of your Enum) from the Enum value → ToString → Get Data Table Row (DT_ClassTypeNames)
5 - Pass the ToString value as argument RowName of the Get Data Table Row Node, this will output a struct containing your LocName, which will translate.
Example:
In this case I use it for the EquipmentType Enum value: