How can the display name of a property be localized?

I want to localize the Property DisplayName in some of my classes. I used the ‘Gather from Meta Data’ feature on the LocalizationDashboard and successfully get the DisplayName of the Property,and translated them, but i found that they don’t take effect when switching languages. I tested ‘Gather from Packages’ and ‘Gather from Text Files’ both of which can correctly collect and translate FText.
What should I do? Is there a correct approach?

To switch language, you need to play in StandAlone and double check current language with a print string if it work.

I hope to localize the display names of properties in the details panel on the editor. The simplified code I’m using is as follows:

class AMyActor : public AActor
{
	GENERATED_BODY()

...

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (
		DisplayName = "TestA",
		Tooltip = "TestA"))
	int32 PropA;
};

“TestA” can be correctly gathered, but its translation cannot be applied to the editor.

2 Likes

I have the same problem, do you find the solution?

You can use a workaround for the Editor: use a static map with FName as the key and FText as the value. After object initialization, write all ObjectName + FPropertyName there as the key and LOCTEXT as the value, and in all cases where you need a display name, just use a function with UObject and Property or with PropertyHandle to get the localized text from this map. By the way, you can use this in standalone mode too. And yes, localized text from metadata doesn’t work in the Editor, who knows why.