mirror of https://github.com/abpframework/abp.git
7 changed files with 87 additions and 52 deletions
@ -0,0 +1,33 @@ |
|||
using Microsoft.Extensions.Localization; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace Volo.Abp.BlazoriseUI.Components.ObjectExtending |
|||
{ |
|||
public static class EnumHelper |
|||
{ |
|||
public static string GetLocalizedMemberName(Type enumType, object value, IStringLocalizerFactory stringLocalizerFactory) |
|||
{ |
|||
var memberName = enumType.GetEnumName(value); |
|||
var localizedMemberName = AbpInternalLocalizationHelper.LocalizeWithFallback( |
|||
new[] |
|||
{ |
|||
stringLocalizerFactory.CreateDefaultOrNull() |
|||
}, |
|||
new[] |
|||
{ |
|||
$"Enum:{enumType.Name}.{memberName}", |
|||
$"{enumType.Name}.{memberName}", |
|||
memberName |
|||
}, |
|||
memberName |
|||
); |
|||
|
|||
return localizedMemberName; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue