Best practice for converting from Enum to FText with localization?

We have a lot of enums in our game, some of which we want to show to the player.

Enums can be automatically converted to String in blueprint, but these string values wouldn’t be added to the translation system.

Currently I’ve made a blueprint function library (in pure BP) that has a function for each of our Enums, that uses a BP select statement to return an FText with the correct value. e.g. GetWeaponTypeText(EWeaponType Type) returns an FText.

Is there another way or a better way that people recommend for this? My solution is OK but seems kinda messy…

That would probably be the best way (and is what we do internally for some of the enums we show to players), as while we do have display name meta-data, it exists for use in the editor rather than in a game.

XMacros can be pretty handy (and I recently used some to sync and enum an an array of structs), but they won’t work with UENUM types since UHT can’t handle them.

Here is an excellent idea I keep using. Pretty good if you don’t mind macros.