filePanel intl patch

pull/5370/head
drafish 2 years ago committed by Aniket
parent e2fcba1358
commit 65e0360b5d
  1. 16
      apps/remix-ide/src/app/tabs/locales/en/filePanel.json
  2. 28
      apps/remix-ide/src/app/tabs/locales/zh/filePanel.json
  3. 48
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -14,7 +14,9 @@
"filePanel.workspace.download": "Download Workspace",
"filePanel.workspace.restore": "Restore Workspace Backup",
"filePanel.workspace.clone": "Clone Git Repository",
"filePanel.workspace.cloneMessage": "Please provide a valid git repository url.",
"filePanel.workspace.enterGitUrl": "Enter git repository url",
"filePanel.workspace.switch": "Switch To Workspace",
"filePanel.workspace.solghaction": "Adds a preset yml file to run solidity unit tests on github actions CI.",
"filePanel.solghaction": "Solidity Test Workflow",
"filePanel.workspace.tssoltestghaction": "Adds a preset yml file to run mocha and chai tests for solidity on github actions CI",
@ -38,5 +40,17 @@
"filePanel.createNewFolder": "Create New Folder",
"filePanel.publishToGist": "Publish all the current workspace files to a github gist",
"filePanel.uploadFile": "Load a local file into current workspace",
"filePanel.updateGist": "Update the current [gist] explorer"
"filePanel.updateGist": "Update the current [gist] explorer",
"filePanel.viewAllBranches": "View all branches",
"filePanel.createBranch": "Create branch",
"filePanel.switchBranches": "Switch branches",
"filePanel.checkoutGitBranch": "Checkout Git Branch",
"filePanel.findOrCreateABranch": "Find or create a branch.",
"filePanel.initGitRepositoryLabel": "Initialize workspace as a new git repository",
"filePanel.initGitRepositoryWarning": "Please add username and email to Remix GitHub Settings to use git features.",
"filePanel.workspaceName": "Workspace name",
"filePanel.customizeTemplate": "Customize template",
"filePanel.features": "Features",
"filePanel.upgradeability": "Upgradeability",
"filePanel.ok": "OK"
}

@ -14,13 +14,15 @@
"filePanel.workspace.download": "下载工作空间",
"filePanel.workspace.restore": "恢复工作空间",
"filePanel.workspace.clone": "克隆 Git 仓库",
"filePanel.workspace.cloneMessage": "请提供有效的 git 仓库 url。",
"filePanel.workspace.enterGitUrl": "输入 Git 仓库地址",
"filePanel.workspace.solghaction": "添加预设 yml 文件以在 github 操作 CI 上运行 solidity 单元测试。",
"filePanel.solghaction": "Solidity Test Workflow",
"filePanel.workspace.tssoltestghaction": "添加一个预设的 yml 文件以在 github 操作 CI 上运行 mocha 和 chai 测试以确保可靠性",
"filePanel.tssoltestghaction": "Mocha Chai Test Workflow",
"filePanel.workspace.slitherghaction": "添加一个预设的 yml 文件以在 github actions CI 上运行 slither 分析",
"filePanel.slitherghaction": "Slither Workflow",
"filePanel.workspace.switch": "切换工作空间",
"filePanel.workspace.solghaction": "添加预设的 yml 文件,这样就可以在 github actions CI 上运行 solidity 单元测试。",
"filePanel.solghaction": "Solidity 测试工作流",
"filePanel.workspace.tssoltestghaction": "添加一个预设的 yml 文件,这样就可以在 github actions CI 上为 solidity 运行 mocha 和 chai 测试",
"filePanel.tssoltestghaction": "Mocha Chai 测试工作流",
"filePanel.workspace.slitherghaction": "添加一个预设的 yml 文件,这样就可以在 github actions CI 上运行 slither 分析",
"filePanel.slitherghaction": "Slither 工作流",
"filePanel.newFile": "新建文件",
"filePanel.newFolder": "新建文件夹",
"filePanel.rename": "重命名",
@ -38,5 +40,17 @@
"filePanel.createNewFolder": "新建文件夹",
"filePanel.publishToGist": "将当前工作空间下所有文件发布到github gist",
"filePanel.uploadFile": "加载本地文件到当前工作空间",
"filePanel.updateGist": "更新当前 [gist] 浏览"
"filePanel.updateGist": "更新当前 [gist] 浏览",
"filePanel.viewAllBranches": "查看所有分支",
"filePanel.createBranch": "创建分支",
"filePanel.switchBranches": "切换分支",
"filePanel.checkoutGitBranch": "切换 Git 分支",
"filePanel.findOrCreateABranch": "查找或创建一个分支。",
"filePanel.initGitRepositoryLabel": "初始化工作空间为一个新的 git 仓库",
"filePanel.initGitRepositoryWarning": "请将用户名和电子邮件添加到 Remix GitHub 设置以使用 git 功能。",
"filePanel.workspaceName": "工作空间名称",
"filePanel.customizeTemplate": "自定义模板",
"filePanel.features": "特点",
"filePanel.upgradeability": "可升级性",
"filePanel.ok": "确认"
}

@ -73,18 +73,18 @@ export function Workspace () {
}, [currentWorkspace])
const renameCurrentWorkspace = () => {
global.modal(intl.formatMessage({ id: 'filePanel.workspace.rename' }), renameModalMessage(), 'OK', onFinishRenameWorkspace, '')
global.modal(intl.formatMessage({ id: 'filePanel.workspace.rename' }), renameModalMessage(), intl.formatMessage({ id: 'filePanel.ok' }), onFinishRenameWorkspace, '')
}
const createWorkspace = () => {
global.modal(intl.formatMessage({ id: 'filePanel.workspace.create' }), createModalMessage(), 'OK', onFinishCreateWorkspace, '')
global.modal(intl.formatMessage({ id: 'filePanel.workspace.create' }), createModalMessage(), intl.formatMessage({ id: 'filePanel.ok' }), onFinishCreateWorkspace, '')
}
const deleteCurrentWorkspace = () => {
global.modal(
intl.formatMessage({ id: 'filePanel.workspace.delete' }),
intl.formatMessage({ id: 'filePanel.workspace.deleteConfirm' }),
'OK',
intl.formatMessage({ id: 'filePanel.ok' }),
onFinishDeleteWorkspace,
''
)
@ -94,7 +94,7 @@ export function Workspace () {
global.modal(
intl.formatMessage({ id: 'filePanel.workspace.clone' }),
cloneModalMessage(),
'OK',
intl.formatMessage({ id: 'filePanel.ok' }),
handleTypingUrl,
''
)
@ -136,7 +136,7 @@ export function Workspace () {
try {
await global.dispatchRenameWorkspace(currentWorkspace, workspaceName)
} catch (e) {
global.modal('Rename Workspace', e.message, 'OK', () => {}, '')
global.modal(intl.formatMessage({ id: 'filePanel.workspace.rename' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '')
console.error(e)
}
}
@ -162,7 +162,7 @@ export function Workspace () {
try {
await global.dispatchCreateWorkspace(workspaceName, workspaceTemplateName, opts, initGitRepo)
} catch (e) {
global.modal('Create Workspace', e.message, 'OK', () => {}, '')
global.modal(intl.formatMessage({ id: 'filePanel.workspace.create' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '')
console.error(e)
}
}
@ -171,7 +171,7 @@ export function Workspace () {
try {
await global.dispatchDeleteWorkspace(global.fs.browser.currentWorkspace)
} catch (e) {
global.modal('Delete Workspace', e.message, 'OK', () => {}, '')
global.modal(intl.formatMessage({ id: 'filePanel.workspace.delete' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '')
console.error(e)
}
}
@ -186,7 +186,7 @@ export function Workspace () {
await global.dispatchSwitchToWorkspace(name)
global.dispatchHandleExpandPath([])
} catch (e) {
global.modal('Switch To Workspace', e.message, 'OK', () => {}, '')
global.modal(intl.formatMessage({ id: 'filePanel.workspace.switch' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {}, '')
console.error(e)
}
}
@ -217,7 +217,13 @@ export function Workspace () {
if (url) {
global.dispatchCloneRepository(url)
} else {
global.modal('Clone Git Repository', 'Please provide a valid git repository url.', 'OK', () => {}, '')
global.modal(
intl.formatMessage({ id: 'filePanel.workspace.clone' }),
intl.formatMessage({ id: 'filePanel.workspace.cloneMessage' }),
intl.formatMessage({ id: 'filePanel.ok' }),
() => {},
''
)
}
}
@ -255,7 +261,7 @@ export function Workspace () {
}
} catch (e) {
console.error(e)
global.modal('Checkout Git Branch', e.message, 'OK', () => {})
global.modal(intl.formatMessage({ id: 'filePanel.checkoutGitBranch' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {})
}
}
@ -264,7 +270,7 @@ export function Workspace () {
await global.dispatchCreateNewBranch(branchFilter)
_paq.push(['trackEvent', 'Workspace', 'GIT', 'switch_to_new_branch'])
} catch (e) {
global.modal('Checkout Git Branch', e.message, 'OK', () => {})
global.modal(intl.formatMessage({ id: 'filePanel.checkoutGitBranch' }), e.message, intl.formatMessage({ id: 'filePanel.ok' }), () => {})
}
}
@ -291,9 +297,9 @@ export function Workspace () {
</select>
<div id="ozcustomization" data-id="ozCustomization" ref={displayOzCustomRef} style={{display: 'none'}} className="mb-2">
<label className="form-check-label d-block mb-2" style={{fontWeight: "bolder"}}>Customize template</label>
<label className="form-check-label d-block mb-2" style={{fontWeight: "bolder"}}><FormattedMessage id='filePanel.customizeTemplate' /></label>
<label id="wsName" className="form-check-label d-block mb-1">Features</label>
<label id="wsName" className="form-check-label d-block mb-1"><FormattedMessage id='filePanel.features' /></label>
<div className="mb-2">
<div className="d-flex ml-2 custom-control custom-checkbox">
<input className="custom-control-input" type="checkbox" name="feature" value="mintable" id="mintable" ref={mintableCheckboxRef} />
@ -309,7 +315,7 @@ export function Workspace () {
</div>
</div>
<label id="wsName" className="form-check-label d-block mb-1">Upgradeability</label>
<label id="wsName" className="form-check-label d-block mb-1"><FormattedMessage id='filePanel.upgradeability' /></label>
<div onChange={handleUpgradeability}>
<div className="d-flex ml-2 custom-control custom-radio">
<input className="custom-control-input" type="radio" name="upgradeability" value="transparent" id="transparent" ref={transparentRadioRef} />
@ -323,7 +329,7 @@ export function Workspace () {
</div>
<label id="wsName" className="form-check-label" style={{fontWeight: "bolder"}} >Workspace name</label>
<label id="wsName" className="form-check-label" style={{fontWeight: "bolder"}} ><FormattedMessage id='filePanel.workspaceName' /></label>
<input type="text" data-id="modalDialogCustomPromptTextCreate" defaultValue={`remixDefault_${Date.now()}`} ref={workspaceCreateInput} className="form-control" />
<div className="d-flex py-2 align-items-center custom-control custom-checkbox">
@ -342,12 +348,12 @@ export function Workspace () {
className="m-0 form-check-label custom-control-label udapp_checkboxAlign"
title="Check option to initialize workspace as a new git repository"
>
Initialize workspace as a new git repository
<FormattedMessage id='filePanel.initGitRepositoryLabel' />
</label>
</div>
{!global.fs.gitConfig.username || !global.fs.gitConfig.email ?
(
<div className='text-warning'>Please add username and email to Remix GitHub Settings to use git features.</div>)
<div className='text-warning'><FormattedMessage id='filePanel.initGitRepositoryWarning' /></div>)
:<></>
}
@ -584,14 +590,14 @@ export function Workspace () {
<Dropdown.Menu as={CustomMenu} className='custom-dropdown-items branches-dropdown'>
<div data-id="custom-dropdown-menu">
<div className='d-flex text-dark' style={{ fontSize: 14, fontWeight: 'bold' }}>
<span className='mt-2 ml-2 mr-auto'>Switch branches</span>
<span className='mt-2 ml-2 mr-auto'><FormattedMessage id='filePanel.switchBranches' /></span>
<div className='pt-2 pr-2' onClick={() => { toggleBranches(false) }}><i className='fa fa-close'></i>
</div>
</div>
<div className='border-top py-2'>
<input
className='form-control border checkout-input bg-light'
placeholder='Find or create a branch.'
placeholder={intl.formatMessage({ id: 'filePanel.findOrCreateABranch' })}
style={{ minWidth: 225 }}
onChange={handleBranchFilterChange}
data-id='workspaceGitInput'
@ -614,13 +620,13 @@ export function Workspace () {
}) :
<Dropdown.Item onClick={switchToNewBranch}>
<div className="pl-1 pr-1" data-id="workspaceGitCreateNewBranch">
<i className="fas fa-code-branch pr-2"></i><span>Create branch: { branchFilter } from '{currentBranch}'</span>
<i className="fas fa-code-branch pr-2"></i><span><FormattedMessage id='filePanel.createBranch' />: { branchFilter } from '{currentBranch}'</span>
</div>
</Dropdown.Item>
}
</div>
{
(selectedWorkspace.branches || []).length > 4 && <div className='text-center border-top pt-2'><label style={{ fontSize: 12, cursor: 'pointer' }} onClick={showAllBranches}>View all branches</label></div>
(selectedWorkspace.branches || []).length > 4 && <div className='text-center border-top pt-2'><label style={{ fontSize: 12, cursor: 'pointer' }} onClick={showAllBranches}><FormattedMessage id='filePanel.viewAllBranches' /></label></div>
}
</div>
</Dropdown.Menu>

Loading…
Cancel
Save