10 changed files with 60 additions and 39 deletions
@ -0,0 +1,10 @@ |
|||||
|
{ |
||||
|
"profiles": { |
||||
|
"BookStore.DbMigrator": { |
||||
|
"commandName": "Project", |
||||
|
"environmentVariables": { |
||||
|
"DOTNET_ENVIRONMENT": "Development" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
namespace BookStore.Identity; |
||||
|
|
||||
|
public enum IdentityUserType |
||||
|
{ |
||||
|
Normal, |
||||
|
Basic |
||||
|
} |
||||
@ -1,8 +1,11 @@ |
|||||
{ |
{ |
||||
"culture": "zh-Hans", |
"culture": "zh-Hans", |
||||
"texts": { |
"texts": { |
||||
"Menu:Home": "首页", |
"Menu:Home": "首页", |
||||
"Welcome": "欢迎", |
"Welcome": "欢迎", |
||||
"LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 abp.io." |
"LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 abp.io.", |
||||
} |
"IdentityUserType": "用户类型", |
||||
} |
"Enum:IdentityUserType.Normal": "标准用户", |
||||
|
"Enum:IdentityUserType.Basic": "基础用户" |
||||
|
} |
||||
|
} |
||||
@ -1,28 +0,0 @@ |
|||||
using System; |
|
||||
using Microsoft.Extensions.Localization; |
|
||||
using Volo.Abp.Localization; |
|
||||
|
|
||||
namespace Lsw.Abp.AntDesignUI.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