fix(module: core): enum name supports localization (#3536)

This commit is contained in:
James Yeung 2023-12-01 00:30:45 +08:00 committed by GitHub
parent 57bdf4b01e
commit 50c13245cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ namespace AntDesign
{
var enumName = Enum.GetName(_enumType, enumValue);
var fieldInfo = _enumType.GetField(enumName);
return fieldInfo.GetCustomAttribute<DisplayAttribute>(true)?.Name ?? enumName;
return fieldInfo.GetCustomAttribute<DisplayAttribute>(true)?.GetName() ?? enumName;
}
private static Func<T, T, T> BuildAggregateFunction()