fix(module: form): use DisplayAttribute.GetName() for localization support (#3426)

This commit is contained in:
huhangfei 2023-10-14 13:14:30 +08:00 committed by GitHub
parent b9877303b6
commit 22c60b4e79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ namespace AntDesign.Core.Reflection
{ {
this.RequiredAttribute = propertyInfo?.GetCustomAttribute<RequiredAttribute>(true); this.RequiredAttribute = propertyInfo?.GetCustomAttribute<RequiredAttribute>(true);
this.DisplayName = propertyInfo?.GetCustomAttribute<DisplayNameAttribute>(true)?.DisplayName ?? this.DisplayName = propertyInfo?.GetCustomAttribute<DisplayNameAttribute>(true)?.DisplayName ??
propertyInfo?.GetCustomAttribute<DisplayAttribute>(true)?.Name; propertyInfo?.GetCustomAttribute<DisplayAttribute>(true)?.GetName();
this.PropertyName = propertyInfo?.Name; this.PropertyName = propertyInfo?.Name;
} }