Skip to content

Commit

Permalink
Menu items and localization adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlcf88 committed Apr 9, 2020
1 parent 1e9abec commit 6286f73
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"culture": "cs",
"texts": {
"Menu:Uniapp": "uni-app",
"Uniapp": "uni-app",
"Menu:UniappManagement": "Uni-app Management",
"Menu:Uniapps": "Uni-app",
"Uniapp": "Uni-app",
"UniappName": "App Name",
"UniappDescription": "Description",
"UniappIconImageUrl": "Icon Image URL",
Expand All @@ -11,7 +12,7 @@
"EditUniapp": "Edit",
"UniappDeletionConfirmationMessage": "Are you sure to delete the uni-app {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"UniappVersion": "uni-app Version",
"UniappVersion": "Uni-app Version",
"UniappVersionAppId": "App ID",
"UniappVersionBuildNumber": "Build Number",
"UniappVersionTag": "Version Tag",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"culture": "en",
"texts": {
"Menu:Uniapp": "uni-app",
"Uniapp": "uni-app",
"Menu:UniappManagement": "Uni-app Management",
"Menu:Uniapps": "Uni-app",
"Uniapp": "Uni-app",
"UniappName": "App Name",
"UniappDescription": "Description",
"UniappIconImageUrl": "Icon Image URL",
Expand All @@ -11,7 +12,7 @@
"EditUniapp": "Edit",
"UniappDeletionConfirmationMessage": "Are you sure to delete the uni-app {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"UniappVersion": "uni-app Version",
"UniappVersion": "Uni-app Version",
"UniappVersionAppId": "App ID",
"UniappVersionBuildNumber": "Build Number",
"UniappVersionTag": "Version Tag",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"culture": "pl",
"texts": {
"Menu:Uniapp": "uni-app",
"Uniapp": "uni-app",
"Menu:UniappManagement": "Uni-app Management",
"Menu:Uniapps": "Uni-app",
"Uniapp": "Uni-app",
"UniappName": "App Name",
"UniappDescription": "Description",
"UniappIconImageUrl": "Icon Image URL",
Expand All @@ -11,7 +12,7 @@
"EditUniapp": "Edit",
"UniappDeletionConfirmationMessage": "Are you sure to delete the uni-app {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"UniappVersion": "uni-app Version",
"UniappVersion": "Uni-app Version",
"UniappVersionAppId": "App ID",
"UniappVersionBuildNumber": "Build Number",
"UniappVersionTag": "Version Tag",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"culture": "pt-BR",
"texts": {
"Menu:Uniapp": "uni-app",
"Uniapp": "uni-app",
"Menu:UniappManagement": "Uni-app Management",
"Menu:Uniapps": "Uni-app",
"Uniapp": "Uni-app",
"UniappName": "App Name",
"UniappDescription": "Description",
"UniappIconImageUrl": "Icon Image URL",
Expand All @@ -11,7 +12,7 @@
"EditUniapp": "Edit",
"UniappDeletionConfirmationMessage": "Are you sure to delete the uni-app {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"UniappVersion": "uni-app Version",
"UniappVersion": "Uni-app Version",
"UniappVersionAppId": "App ID",
"UniappVersionBuildNumber": "Build Number",
"UniappVersionTag": "Version Tag",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"culture": "sl",
"texts": {
"Menu:Uniapp": "uni-app",
"Uniapp": "uni-app",
"Menu:UniappManagement": "Uni-app Management",
"Menu:Uniapps": "Uni-app",
"Uniapp": "Uni-app",
"UniappName": "App Name",
"UniappDescription": "Description",
"UniappIconImageUrl": "Icon Image URL",
Expand All @@ -11,7 +12,7 @@
"EditUniapp": "Edit",
"UniappDeletionConfirmationMessage": "Are you sure to delete the uni-app {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"UniappVersion": "uni-app Version",
"UniappVersion": "Uni-app Version",
"UniappVersionAppId": "App ID",
"UniappVersionBuildNumber": "Build Number",
"UniappVersionTag": "Version Tag",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"culture": "tr",
"texts": {
"Menu:Uniapp": "uni-app",
"Uniapp": "uni-app",
"Menu:UniappManagement": "Uni-app Management",
"Menu:Uniapps": "Uni-app",
"Uniapp": "Uni-app",
"UniappName": "App Name",
"UniappDescription": "Description",
"UniappIconImageUrl": "Icon Image URL",
Expand All @@ -11,7 +12,7 @@
"EditUniapp": "Edit",
"UniappDeletionConfirmationMessage": "Are you sure to delete the uni-app {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"UniappVersion": "uni-app Version",
"UniappVersion": "Uni-app Version",
"UniappVersionAppId": "App ID",
"UniappVersionBuildNumber": "Build Number",
"UniappVersionTag": "Version Tag",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"culture": "vi",
"texts": {
"Menu:Uniapp": "uni-app",
"Uniapp": "uni-app",
"Menu:UniappManagement": "Uni-app Management",
"Menu:Uniapps": "Uni-app",
"Uniapp": "Uni-app",
"UniappName": "App Name",
"UniappDescription": "Description",
"UniappIconImageUrl": "Icon Image URL",
Expand All @@ -11,7 +12,7 @@
"EditUniapp": "Edit",
"UniappDeletionConfirmationMessage": "Are you sure to delete the uni-app {0}?",
"SuccessfullyDeleted": "Successfully deleted",
"UniappVersion": "uni-app Version",
"UniappVersion": "Uni-app Version",
"UniappVersionAppId": "App ID",
"UniappVersionBuildNumber": "Build Number",
"UniappVersionTag": "Version Tag",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"culture": "zh-Hans",
"texts": {
"Menu:Uniapp": "uni-app 管理",
"Uniapp": "uni-app",
"Menu:UniappManagement": "Uni-app 管理",
"Menu:Uniapps": "Uni-app",
"Uniapp": "Uni-app",
"UniappName": "应用名称",
"UniappDescription": "应用介绍",
"UniappIconImageUrl": "图标 URL",
Expand All @@ -11,7 +12,7 @@
"EditUniapp": "编辑",
"UniappDeletionConfirmationMessage": "确认删除应用 {0}?",
"SuccessfullyDeleted": "删除成功",
"UniappVersion": "uni-app 版本管理",
"UniappVersion": "Uni-app 版本管理",
"UniappVersionAppId": "应用 ID",
"UniappVersionBuildNumber": "版本序号",
"UniappVersionTag": "版本 Tag",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"culture": "zh-Hant",
"texts": {
"Menu:Uniapp": "uni-app管理",
"Uniapp": "uni-app",
"Menu:UniappManagement": "Uni-app 管理",
"Menu:Uniapps": "Uni-app",
"Uniapp": "Uni-app",
"UniappName": "應用名稱",
"UniappDescription": "應用介紹",
"UniappIconImageUrl": "圖標URL",
"UniappIconImageUrl": "圖標 URL",
"UniappIsAvailable": "啟用",
"CreateUniapp": "新建應用",
"EditUniapp": "編輯",
"UniappDeletionConfirmationMessage": "確認删除應用{0}",
"UniappDeletionConfirmationMessage": "確認删除應用 {0}?",
"SuccessfullyDeleted": "删除成功",
"UniappVersion": "uni-app版本管理",
"UniappVersionAppId": "應用ID",
"UniappVersion": "Uni-app 版本管理",
"UniappVersionAppId": "應用 ID",
"UniappVersionBuildNumber": "版本序號",
"UniappVersionTag": "版本Tag",
"UniappVersionTag": "版本 Tag",
"UniappVersionWgtUrl": "WgtUrl",
"UniappVersionPkgUrl": "PkgUrl",
"CreateUniappVersion": "新建版本",
"EditUniappVersion": "編輯",
"UniappVersionDeletionConfirmationMessage": "確認删除版本{0}"
"UniappVersionDeletionConfirmationMessage": "確認删除版本 {0}?"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
@{
PageLayout.Content.Title = $"{L["UniappVersion"].Value} ({Model.Uniapp.Name})";
PageLayout.Content.BreadCrumb.Add(L["Menu:Uniapp"].Value);
PageLayout.Content.BreadCrumb.Add(L["Menu:Uniapps"].Value);
PageLayout.Content.MenuItemName = "Uniapp";

var cardTitle = $"{L["UniappVersion"].Value} ({Model.Uniapp.Name})";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
@{
PageLayout.Content.Title = L["Uniapp"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:Uniapp"].Value);
PageLayout.Content.BreadCrumb.Add(L["Menu:Uniapps"].Value);
PageLayout.Content.MenuItemName = "Uniapp";
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.UniappManagement.Authorization;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -23,17 +24,23 @@ public async Task ConfigureMenuAsync(MenuConfigurationContext context)

private async Task ConfigureMainMenu(MenuConfigurationContext context)
{
var administrationMenuItem = context.Menu.GetAdministration();
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<UniappManagementResource>>(); //Add main menu items.

var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();

var uniappManagementMenuItem = new ApplicationMenuItem("UniappManagement", l["Menu:UniappManagement"]);

if (await authorizationService.IsGrantedAsync(UniappManagementPermissions.Uniapps.Default))
{
administrationMenuItem.AddItem(
new ApplicationMenuItem("Uniapp", l["Menu:Uniapp"], "/UniappManagement/Uniapps/Uniapp")
uniappManagementMenuItem.AddItem(
new ApplicationMenuItem("Uniapp", l["Menu:Uniapps"], "/UniappManagement/Uniapps/Uniapp")
);
}

if (!uniappManagementMenuItem.Items.IsNullOrEmpty())
{
context.Menu.AddItem(uniappManagementMenuItem);
}
}
}
}

0 comments on commit 6286f73

Please sign in to comment.