fix some translations

pull/2581/head
drafish 2 years ago
parent 898fb99625
commit 72d5831b53
  1. 17
      apps/remix-ide/src/app/tabs/locales/en-US.js
  2. 11
      apps/remix-ide/src/app/tabs/locales/zh-CN.js
  3. 9
      libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx
  4. 17
      libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx
  5. 21
      libs/remix-ui/home-tab/src/lib/components/homeTabScamAlert.tsx
  6. 30
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -30,16 +30,19 @@ export default {
'settings.ipfs': 'IPFS Settings',
'filePanel.displayName': 'File explorer',
'filePanel.workspace': 'Workspaces',
'filePanel.workspace': 'WORKSPACES',
'filePanel.create': 'Create',
'filePanel.clone': 'Clone',
'filePanel.download': 'Download',
'filePanel.restore': 'Restore',
'filePanel.workspace.create': 'Create Workspace',
'filePanel.workspace.rename': 'Rename Current Workspace',
'filePanel.workspace.delete': 'Delete Current Workspace',
'filePanel.workspace.rename': 'Rename Workspace',
'filePanel.workspace.delete': 'Delete Workspace',
'filePanel.workspace.deleteConfirm': 'Are you sure to delete the current workspace?',
'filePanel.workspace.name': 'Workspace name',
'filePanel.workspace.chooseTemplate': 'Choose a template',
'filePanel.workspace.download': 'Download Workspaces',
'filePanel.workspace.restore': 'Restore Workspaces Backup',
'filePanel.workspace.download': 'Download Workspace',
'filePanel.workspace.restore': 'Restore Workspace Backup',
'filePanel.workspace.clone': 'Clone Git Repository',
'filePanel.workspace.enterGitUrl': 'Enter git repository url',
'filePanel.newFile': 'New File',
@ -68,9 +71,9 @@ export default {
'home.learnMore': 'Learn more',
'home.here': 'here',
'home.featuredPlugins': 'Featured Plugins',
'home.file': 'File',
'home.files': 'Files',
'home.newFile': 'New File',
'home.openFiles': 'Open Files',
'home.openFile': 'Open File',
'home.connectToLocalhost': 'Connect to Localhost',
'home.loadFrom': 'LOAD FROM',
'home.resources': 'Resources',

@ -32,9 +32,12 @@ export default {
'filePanel.displayName': '文件浏览器',
'filePanel.workspace': '工作空间',
'filePanel.create': '新建',
'filePanel.clone': '克隆',
'filePanel.download': '下载',
'filePanel.restore': '恢复',
'filePanel.workspace.create': '新建工作空间',
'filePanel.workspace.rename': '重命名当前工作空间',
'filePanel.workspace.delete': '删除当前工作空间',
'filePanel.workspace.rename': '重命名工作空间',
'filePanel.workspace.delete': '删除工作空间',
'filePanel.workspace.deleteConfirm': '确定要删除当前工作空间?',
'filePanel.workspace.name': '工作空间名称',
'filePanel.workspace.chooseTemplate': '选择一个工作空间模板',
@ -68,9 +71,9 @@ export default {
'home.learnMore': '了解更多',
'home.here': '这里',
'home.featuredPlugins': '精选插件',
'home.file': '文件',
'home.files': '文件',
'home.newFile': '新建文件',
'home.openFiles': '上传本地文件',
'home.openFile': '打开本地文件',
'home.connectToLocalhost': '连接本地主机',
'home.loadFrom': '从以下来源导入',
'home.resources': '资源',

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import React, { useEffect, useState, useRef, useContext } from 'react'
import { FormattedMessage } from 'react-intl'
import PluginButton from './pluginButton'
import { ThemeContext, themes } from '../themeContext'
import Carousel from 'react-multi-carousel'
@ -51,19 +52,19 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) {
await plugin.appManager.activatePlugin(['solidity', 'sourcify'])
plugin.verticalIcons.select('sourcify')
_paq.push(['trackEvent', 'pluginManager', 'userActivate', 'sourcify'])
}
}
const startSolidityUnitTesting = async () => {
await plugin.appManager.activatePlugin(['solidity', 'solidityUnitTesting'])
plugin.verticalIcons.select('solidityUnitTesting')
_paq.push(['trackEvent', 'pluginManager', 'userActivate', 'solidityUnitTesting'])
}
return (
<div className="pl-2 w-100" id="hTFeaturedPlugins">
<label className="" style={{fontSize: "1.2rem"}}>Featured Plugins</label>
<label className="" style={{fontSize: "1.2rem"}}><FormattedMessage id='home.featuredPlugins' defaultMessage='Featured Plugins' /></label>
<div className="w-100 d-flex flex-column">
<ThemeContext.Provider value={ themeFilter }>
<Carousel
<Carousel
ref={carouselRef}
focusOnSelect
customButtonGroup={<CustomNavButtons next={undefined} previous={undefined} goToSlide={undefined} />}

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import React, { useState, useRef, useReducer } from 'react'
import { FormattedMessage } from 'react-intl'
import { ModalDialog } from '@remix-ui/modal-dialog' // eslint-disable-line
import { Toaster } from '@remix-ui/toaster' // eslint-disable-line
@ -51,7 +52,7 @@ function HomeTabFile ({plugin}: HomeTabFileProps) {
else {
workspace.addExternal(type + '/' + cleanUrl, content, url)
plugin.call('menuicons', 'select', 'filePanel')
}
}
} catch (e) {
toast(e.message)
}
@ -137,20 +138,20 @@ function HomeTabFile ({plugin}: HomeTabFileProps) {
</ModalDialog>
<Toaster message={state.toasterMsg} />
<div className="justify-content-start mt-1 p-2 border-bottom d-flex flex-column" id="hTFileSection">
<label style={{fontSize: "1rem"}}>Files</label>
<button className="btn btn-primary p-2 border my-1" data-id="homeTabNewFile" style={{width: 'fit-content'}} onClick={() => createNewFile()}>New File</button>
<label className="btn p-2 border my-1" style={{width: 'fit-content'}} htmlFor="openFileInput">Open File</label>
<label style={{fontSize: "1rem"}}><FormattedMessage id='home.file' defaultMessage='Files' /></label>
<button className="btn btn-primary p-2 border my-1" data-id="homeTabNewFile" style={{width: 'fit-content'}} onClick={() => createNewFile()}><FormattedMessage id='home.newFile' defaultMessage='New File' /></button>
<label className="btn p-2 border my-1" style={{width: 'fit-content'}} htmlFor="openFileInput"><FormattedMessage id='home.openFile' defaultMessage='Open File' /></label>
<input title="open file" type="file" id="openFileInput" onChange={(event) => {
event.stopPropagation()
plugin.verticalIcons.select('filePanel')
uploadFile(event.target)
}} multiple />
<button className="btn p-2 border my-1" style={{width: 'fit-content'}} onClick={() => connectToLocalhost()}>Connect to Localhost</button>
<label className="pt-2">Load From</label>
<button className="btn p-2 border my-1" style={{width: 'fit-content'}} onClick={() => connectToLocalhost()}><FormattedMessage id='home.connectToLocalhost' defaultMessage='Connect to Localhost' /></button>
<label className="pt-2"><FormattedMessage id='home.loadFrom' defaultMessage='Load From' /></label>
<div className="d-flex">
<button className="btn p-2 border mr-2" data-id="landingPageImportFromGitHubButton" onClick={() => showFullMessage('GitHub', 'github URL', ['https://github.com/0xcert/ethereum-erc721/src/contracts/tokens/nf-token-metadata.sol', 'https://github.com/OpenZeppelin/openzeppelin-solidity/blob/67bca857eedf99bf44a4b6a0fc5b5ed553135316/contracts/access/Roles.sol'])}>GitHub</button>
<button className="btn p-2 border mr-2" data-id="landingPageImportFromGistButton" onClick={() => importFromGist()}>Gist</button>
<button className="btn p-2 border mr-2" onClick={() => showFullMessage('Ipfs', 'ipfs URL', ['ipfs://<ipfs-hash>'])}>IPFS</button>
<button className="btn p-2 border mr-2" onClick={() => showFullMessage('Ipfs', 'ipfs URL', ['ipfs://<ipfs-hash>'])}>IPFS</button>
<button className="btn p-2 border" onClick={() => showFullMessage('Https', 'http/https raw content', ['https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol'])}>HTTPS</button>
</div>
</div>
@ -158,4 +159,4 @@ function HomeTabFile ({plugin}: HomeTabFileProps) {
)
}
export default HomeTabFile
export default HomeTabFile

@ -1,24 +1,31 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import React from 'react'
import { FormattedMessage } from 'react-intl'
function HomeTabScamAlert () {
return (
<div className="" id="hTScamAlertSection">
<label className="pl-2 text-danger" style={{fontSize: "1.2rem"}}>Scam Alert</label>
<label className="pl-2 text-danger" style={{fontSize: "1.2rem"}}><FormattedMessage id='home.scamAlert' defaultMessage='Scam Alerts' /></label>
<div className="py-2 ml-2 mb-1 align-self-end mb-2 d-flex flex-column border border-danger">
<span className="pl-4 mt-2">
<i className="pr-2 text-danger fas fa-exclamation-triangle"></i>
<b>Scam Alerts:</b>
<b><FormattedMessage id='home.scamAlert' defaultMessage='Scam Alerts' />:</b>
</span>
<span className="pl-4 mt-1">
The only URL Remix uses is remix.ethereum.org
<FormattedMessage id='home.scamAlertText' defaultMessage='The only URL Remix uses is remix.ethereum.org' />
</span>
<span className="pl-4 mt-1">
Beware of online videos promoting "liquidity front runner bots":
<a className="pl-2 remixui_home_text" target="__blank" href="https://medium.com/remix-ide/remix-in-youtube-crypto-scams-71c338da32d">Learn more</a>
<span className="pl-4 mt-1">
<FormattedMessage id='home.scamAlertText2' defaultMessage='Beware of online videos promoting "liquidity front runner bots"' />:
<a className="pl-2 remixui_home_text" target="__blank" href="https://medium.com/remix-ide/remix-in-youtube-crypto-scams-71c338da32d">
<FormattedMessage id='home.learnMore' defaultMessage='Learn more' />
</a>
</span>
<span className="pl-4 mt-1">
Additional safety tips: &nbsp;<a className="remixui_home_text" target="__blank" href="https://remix-ide.readthedocs.io/en/latest/security.html">here</a>
<FormattedMessage id='home.scamAlertText3' defaultMessage='Additional safety tips' />
: &nbsp;
<a className="remixui_home_text" target="__blank" href="https://remix-ide.readthedocs.io/en/latest/security.html">
<FormattedMessage id='home.here' defaultMessage='here' />
</a>
</span>
</div>
</div>

@ -318,7 +318,7 @@ export function Workspace () {
placement="right"
overlay={
<Tooltip id="createWorkspaceTooltip" className="text-nowrap">
<span>Create</span>
<span><FormattedMessage id='filePanel.workspace.create' defaultMessage='Create Workspace' /></span>
</Tooltip>
}
>
@ -344,14 +344,14 @@ export function Workspace () {
className='far fa-plus pl-2'
>
</span>
<span className="pl-3">Create</span>
<span className="pl-3"><FormattedMessage id='filePanel.create' defaultMessage='Create' /></span>
</div>
</OverlayTrigger>,
<OverlayTrigger
placement="right-start"
overlay={
<Tooltip id="createWorkspaceTooltip" className="text-nowrap">
<span>Delete Workspace</span>
<span><FormattedMessage id='filePanel.workspace.delete' defaultMessage='Delete Workspace' /></span>
</Tooltip>
}
>
@ -377,14 +377,14 @@ export function Workspace () {
className='far fa-trash pl-2'
>
</span>
<span className="pl-3">{'Delete'}</span>
<span className="pl-3"><FormattedMessage id='filePanel.delete' defaultMessage='Delete' /></span>
</div>
</OverlayTrigger>,
<OverlayTrigger
placement='right-start'
overlay={
<Tooltip id="workspaceRenametooltip">
<span>Rename Workspace</span>
<span><FormattedMessage id='filePanel.workspace.rename' defaultMessage='Rename Workspace' /></span>
</Tooltip>
}
>
@ -408,7 +408,7 @@ export function Workspace () {
}}
className='far fa-edit pl-2'>
</span>
<span className="pl-3">{'Rename'}</span>
<span className="pl-3"><FormattedMessage id='filePanel.rename' defaultMessage='Rename' /></span>
</div>
</OverlayTrigger>,
<Dropdown.Divider className="border mb-0 mt-0" />,
@ -416,7 +416,7 @@ export function Workspace () {
placement="right-start"
overlay={
<Tooltip id="cloneWorkspaceTooltip" className="text-nowrap">
<span>Clone Git Repository</span>
<span><FormattedMessage id='filePanel.workspace.clone' defaultMessage='Clone Git Repository' /></span>
</Tooltip>
}
>
@ -442,7 +442,7 @@ export function Workspace () {
className='fab fa-github pl-2'
>
</span>
<span className="pl-3">{'Clone'}</span>
<span className="pl-3"><FormattedMessage id='filePanel.clone' defaultMessage='Clone' /></span>
</div>
</OverlayTrigger>,
<Dropdown.Divider className="border mt-0 mb-0 remixui_menuhr" style={{ pointerEvents: 'none' }}/>,
@ -450,7 +450,7 @@ export function Workspace () {
placement="right-start"
overlay={
<Tooltip id="createWorkspaceTooltip" className="text-nowrap">
<span>Download Workspace</span>
<span><FormattedMessage id='filePanel.workspace.download' defaultMessage='Download Workspace' /></span>
</Tooltip>
}
>
@ -476,14 +476,14 @@ export function Workspace () {
className='far fa-download pl-2 '
>
</span>
<span className="pl-3">{'Download'}</span>
<span className="pl-3"><FormattedMessage id='filePanel.download' defaultMessage='Download' /></span>
</div>
</OverlayTrigger>,
<OverlayTrigger
placement="right-start"
overlay={
<Tooltip id="createWorkspaceTooltip" className="text-nowrap">
<span>Restore Workspace Backup</span>
<span><FormattedMessage id='filePanel.workspace.restore' defaultMessage='Restore Workspace Backup' /></span>
</Tooltip>
}
>
@ -509,7 +509,7 @@ export function Workspace () {
className='far fa-upload pl-2'
>
</span>
<span className="pl-3">{'Restore'}</span>
<span className="pl-3"><FormattedMessage id='filePanel.restore' defaultMessage='Restore' /></span>
</div>
</OverlayTrigger>,
]
@ -522,8 +522,8 @@ export function Workspace () {
<div className="mx-2 mb-2 d-flex flex-column">
<div className="d-flex justify-content-between">
<span className="d-flex align-items-end">
<label className="pl-1 form-check-label" htmlFor="workspacesSelect">
WORKSPACES
<label className="pl-1 form-check-label" htmlFor="workspacesSelect" style={{wordBreak: 'keep-all'}}>
<FormattedMessage id='filePanel.workspace' defaultMessage='WORKSPACES' />
</label>
</span>
<span className="remixui_menu remixui_topmenu d-flex justify-content-between align-items-end w-75">
@ -531,7 +531,7 @@ export function Workspace () {
placement="top-end"
overlay={
<Tooltip id="createWorkspaceTooltip" className="text-nowrap">
<span>Create</span>
<span><FormattedMessage id='filePanel.create' defaultMessage='create' /></span>
</Tooltip>
}
>

Loading…
Cancel
Save