From f0048f06cb0def8e375a18b5be3765b365baa20e Mon Sep 17 00:00:00 2001 From: drafish Date: Tue, 29 Nov 2022 16:53:47 +0800 Subject: [PATCH] add some pluginManager locale messages --- .../src/app/tabs/locales/en/pluginManager.json | 11 ++++++++++- .../src/app/tabs/locales/zh/pluginManager.json | 11 ++++++++++- .../src/lib/components/permissionsSettings.tsx | 18 ++++++++++-------- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/pluginManager.json b/apps/remix-ide/src/app/tabs/locales/en/pluginManager.json index d0d6c8833c..01287713d6 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/pluginManager.json +++ b/apps/remix-ide/src/app/tabs/locales/en/pluginManager.json @@ -18,5 +18,14 @@ "pluginManager.localForm.locationInRemix": "Location in remix", "pluginManager.localForm.sidePanel": "Side Panel", "pluginManager.localForm.mainPanel": "Main Panel", - "pluginManager.localForm.none": "None" + "pluginManager.localForm.none": "None", + "pluginManager.Permissions": "Permissions", + "pluginManager.permissions": "permissions", + "pluginManager.pluginManagerPermissions": "Plugin Manager Permissions", + "pluginManager.currentPermissionSettings": "Current Permission Settings", + "pluginManager.noPermissionRequestedYet": "No Permission requested yet.", + "pluginManager.allow": "Allow", + "pluginManager.toCall": "to call", + "pluginManager.ok": "OK", + "pluginManager.cancel": "Cancel" } diff --git a/apps/remix-ide/src/app/tabs/locales/zh/pluginManager.json b/apps/remix-ide/src/app/tabs/locales/zh/pluginManager.json index e441ce128f..423e11ce5e 100644 --- a/apps/remix-ide/src/app/tabs/locales/zh/pluginManager.json +++ b/apps/remix-ide/src/app/tabs/locales/zh/pluginManager.json @@ -18,5 +18,14 @@ "pluginManager.localForm.locationInRemix": "在Remix中的位置", "pluginManager.localForm.sidePanel": "侧面板", "pluginManager.localForm.mainPanel": "主面板", - "pluginManager.localForm.none": "无" + "pluginManager.localForm.none": "无", + "pluginManager.Permissions": "权限", + "pluginManager.permissions": "权限", + "pluginManager.pluginManagerPermissions": "插件管理权限", + "pluginManager.currentPermissionSettings": "当前权限设置", + "pluginManager.noPermissionRequestedYet": "目前还没有权限请求。", + "pluginManager.allow": "允许", + "pluginManager.toCall": "调用", + "pluginManager.ok": "确认", + "pluginManager.cancel": "取消" } diff --git a/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx b/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx index 5936ec3f0d..f75c2e9cd9 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import React, { Fragment, useState } from 'react' // eslint-disable-line no-use-before-define +import { FormattedMessage, useIntl } from 'react-intl' /* eslint-disable-line */ import { ModalDialog } from '@remix-ui/modal-dialog' import useLocalStorage from '../custom-hooks/useLocalStorage' @@ -9,6 +10,7 @@ function PermisssionsSettings () { const [modalVisibility, setModalVisibility] = useState(true) const [permissions, setPermissions] = useLocalStorage('plugins/permissions', {} as PluginPermissions) const [permissionCache, setpermissionCache] = useState() + const intl = useIntl() const closeModal = () => setModalVisibility(true) const openModal = () => { const currentValue = JSON.parse(window.localStorage.getItem('plugins/permissions') || '{}') @@ -51,7 +53,7 @@ function PermisssionsSettings () { function RenderPluginHeader ({ headingName }) { return (
-

{headingName} permissions:

+

{headingName} :

{ clearTargetPermission(headingName) @@ -83,7 +85,7 @@ function PermisssionsSettings () { htmlFor={`permission-checkbox-${targetPlugin}-${funcName}-${targetPlugin}`} data-id={`permission-label-${targetPlugin}-${funcName}-${targetPlugin}`} > - Allow {pluginName} to call {funcName} + {pluginName} {funcName}
{permissions && Object.keys(permissions).length > 0 - ? (

Current Permission Settings

) - : (

No Permission requested yet.

) + ? (

) + : (

) }
@@ -132,7 +134,7 @@ function PermisssionsSettings () { onClick={openModal} className="btn btn-primary settings-button" data-id="pluginManagerPermissionsButton"> - Permissions +