From 640427d722582472995cb2ff110d2e3780a2a5c3 Mon Sep 17 00:00:00 2001 From: drafish Date: Fri, 29 Jul 2022 16:18:51 +0800 Subject: [PATCH] add some locale message --- apps/remix-ide/src/app/tabs/locales/en-US.js | 8 ++++++++ apps/remix-ide/src/app/tabs/locales/zh-CN.js | 8 ++++++++ .../panel/src/lib/plugins/panel-header.tsx | 8 ++++---- .../src/lib/compiler-container.tsx | 12 +++++++++++- .../workspace/src/lib/remix-ui-workspace.tsx | 18 +++++++++++++++--- 5 files changed, 46 insertions(+), 8 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en-US.js b/apps/remix-ide/src/app/tabs/locales/en-US.js index b854ab5957..6b2382a669 100644 --- a/apps/remix-ide/src/app/tabs/locales/en-US.js +++ b/apps/remix-ide/src/app/tabs/locales/en-US.js @@ -1,4 +1,9 @@ export default { + 'panel.author': 'Author', + 'panel.maintainedBy': 'Maintained By', + 'panel.documentation': 'Documentation', + 'panel.description': 'Description', + 'settings.displayName': 'Settings', 'settings.reset': 'Reset to Default settings', 'settings.general': 'General settings', @@ -31,6 +36,8 @@ export default { 'filePanel.workspace.chooseTemplate': 'Choose a template', 'filePanel.workspace.download': 'Download Workspaces', 'filePanel.workspace.restore': 'Restore Workspaces Backup', + 'filePanel.workspace.clone': 'Clone Git Repository', + 'filePanel.workspace.enterGitUrl': 'Enter git repository url', 'filePanel.newFile': 'New File', 'filePanel.newFolder': 'New Folder', 'filePanel.rename': 'Rename', @@ -139,6 +146,7 @@ export default { 'solidity.useConfigurationFile': 'Use configuration file', 'solidity.change': 'Change', 'solidity.compile': 'Compile', + 'solidity.noFileSelected': 'no file selected', 'solidity.compileAndRunScript': 'Compile and Run script', 'solidity.publishOn': 'Publish on', 'solidity.Assembly': 'Assembly opcodes describing the contract including corresponding solidity source code', diff --git a/apps/remix-ide/src/app/tabs/locales/zh-CN.js b/apps/remix-ide/src/app/tabs/locales/zh-CN.js index 10aef2ce46..8a9755a7df 100644 --- a/apps/remix-ide/src/app/tabs/locales/zh-CN.js +++ b/apps/remix-ide/src/app/tabs/locales/zh-CN.js @@ -1,4 +1,9 @@ export default { + 'panel.author': '作者', + 'panel.maintainedBy': '维护者', + 'panel.documentation': '文档', + 'panel.description': '描述', + 'settings.displayName': '设置', 'settings.reset': '恢复默认设置', 'settings.general': '常规设置', @@ -31,6 +36,8 @@ export default { 'filePanel.workspace.chooseTemplate': '选择一个工作空间模板', 'filePanel.workspace.download': '下载工作空间', 'filePanel.workspace.restore': '恢复工作空间', + 'filePanel.workspace.clone': '克隆 Git 仓库', + 'filePanel.workspace.enterGitUrl': '输入 Git 仓库地址', 'filePanel.newFile': '新建文件', 'filePanel.newFolder': '新建文件夹', 'filePanel.rename': '重命名', @@ -139,6 +146,7 @@ export default { 'solidity.useConfigurationFile': '使用配置文件', 'solidity.change': '修改', 'solidity.compile': '编译', + 'solidity.noFileSelected': '未选中文件', 'solidity.compileAndRunScript': '编译且执行脚本', 'solidity.publishOn': '发布到', 'solidity.Assembly': '合约的汇编操作码,包含对应的solidity源程序', diff --git a/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx b/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx index 47d167e9ef..c1349f44e0 100644 --- a/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx +++ b/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx @@ -43,21 +43,21 @@ const RemixUIPanelHeader = (props: RemixPanelProps) => {
{plugin?.profile?.author && - + { plugin?.profile.author } } {plugin?.profile?.maintainedBy && - + { plugin?.profile.maintainedBy } } {plugin?.profile?.documentation && - + } {plugin?.profile?.description && - + { plugin?.profile.description } } {plugin?.profile?.repo && diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 18ae8d6546..64e4a96782 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -886,7 +886,17 @@ export const CompilerContainer = (props: CompilerContainerProps) => { }> { } - { typeof state.compiledFileName === 'string' ? extractNameFromKey(state.compiledFileName) || '' : '' } + + {typeof state.compiledFileName === 'string' + ? extractNameFromKey(state.compiledFileName) || + `<${intl.formatMessage({ + id: 'solidity.noFileSelected', + defaultMessage: 'no file selected', + })}>` + : `<${intl.formatMessage({ + id: 'solidity.noFileSelected', + defaultMessage: 'no file selected', + })}>`} diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 3bea451ed6..cc99ee045a 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -72,7 +72,13 @@ export function Workspace () { } const cloneGitRepository = () => { - global.modal('Clone Git Repository', cloneModalMessage(), 'OK', handleTypingUrl, '') + global.modal( + intl.formatMessage({id: 'filePanel.workspace.clone', defaultMessage: 'Clone Git Repository'}), + cloneModalMessage(), + 'OK', + handleTypingUrl, + '' + ) } const downloadWorkspaces = async () => { @@ -190,7 +196,13 @@ export function Workspace () { const cloneModalMessage = () => { return ( <> - + ) } @@ -269,7 +281,7 @@ export function Workspace () { cloneGitRepository() }} className='far fa-clone remixui_menuicon' - title='Clone Git Repository'> + title={intl.formatMessage({id: 'filePanel.workspace.clone', defaultMessage: 'Clone Git Repository'})}>