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. 3
      libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx
  4. 11
      libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx
  5. 19
      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', 'settings.ipfs': 'IPFS Settings',
'filePanel.displayName': 'File explorer', 'filePanel.displayName': 'File explorer',
'filePanel.workspace': 'Workspaces', 'filePanel.workspace': 'WORKSPACES',
'filePanel.create': 'Create', 'filePanel.create': 'Create',
'filePanel.clone': 'Clone',
'filePanel.download': 'Download',
'filePanel.restore': 'Restore',
'filePanel.workspace.create': 'Create Workspace', 'filePanel.workspace.create': 'Create Workspace',
'filePanel.workspace.rename': 'Rename Current Workspace', 'filePanel.workspace.rename': 'Rename Workspace',
'filePanel.workspace.delete': 'Delete Current Workspace', 'filePanel.workspace.delete': 'Delete Workspace',
'filePanel.workspace.deleteConfirm': 'Are you sure to delete the current workspace?', 'filePanel.workspace.deleteConfirm': 'Are you sure to delete the current workspace?',
'filePanel.workspace.name': 'Workspace name', 'filePanel.workspace.name': 'Workspace name',
'filePanel.workspace.chooseTemplate': 'Choose a template', 'filePanel.workspace.chooseTemplate': 'Choose a template',
'filePanel.workspace.download': 'Download Workspaces', 'filePanel.workspace.download': 'Download Workspace',
'filePanel.workspace.restore': 'Restore Workspaces Backup', 'filePanel.workspace.restore': 'Restore Workspace Backup',
'filePanel.workspace.clone': 'Clone Git Repository', 'filePanel.workspace.clone': 'Clone Git Repository',
'filePanel.workspace.enterGitUrl': 'Enter git repository url', 'filePanel.workspace.enterGitUrl': 'Enter git repository url',
'filePanel.newFile': 'New File', 'filePanel.newFile': 'New File',
@ -68,9 +71,9 @@ export default {
'home.learnMore': 'Learn more', 'home.learnMore': 'Learn more',
'home.here': 'here', 'home.here': 'here',
'home.featuredPlugins': 'Featured Plugins', 'home.featuredPlugins': 'Featured Plugins',
'home.file': 'File', 'home.files': 'Files',
'home.newFile': 'New File', 'home.newFile': 'New File',
'home.openFiles': 'Open Files', 'home.openFile': 'Open File',
'home.connectToLocalhost': 'Connect to Localhost', 'home.connectToLocalhost': 'Connect to Localhost',
'home.loadFrom': 'LOAD FROM', 'home.loadFrom': 'LOAD FROM',
'home.resources': 'Resources', 'home.resources': 'Resources',

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

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
import React, { useEffect, useState, useRef, useContext } from 'react' import React, { useEffect, useState, useRef, useContext } from 'react'
import { FormattedMessage } from 'react-intl'
import PluginButton from './pluginButton' import PluginButton from './pluginButton'
import { ThemeContext, themes } from '../themeContext' import { ThemeContext, themes } from '../themeContext'
import Carousel from 'react-multi-carousel' import Carousel from 'react-multi-carousel'
@ -60,7 +61,7 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) {
return ( return (
<div className="pl-2 w-100" id="hTFeaturedPlugins"> <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"> <div className="w-100 d-flex flex-column">
<ThemeContext.Provider value={ themeFilter }> <ThemeContext.Provider value={ themeFilter }>
<Carousel <Carousel

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
import React, { useState, useRef, useReducer } from 'react' import React, { useState, useRef, useReducer } from 'react'
import { FormattedMessage } from 'react-intl'
import { ModalDialog } from '@remix-ui/modal-dialog' // eslint-disable-line import { ModalDialog } from '@remix-ui/modal-dialog' // eslint-disable-line
import { Toaster } from '@remix-ui/toaster' // eslint-disable-line import { Toaster } from '@remix-ui/toaster' // eslint-disable-line
@ -137,16 +138,16 @@ function HomeTabFile ({plugin}: HomeTabFileProps) {
</ModalDialog> </ModalDialog>
<Toaster message={state.toasterMsg} /> <Toaster message={state.toasterMsg} />
<div className="justify-content-start mt-1 p-2 border-bottom d-flex flex-column" id="hTFileSection"> <div className="justify-content-start mt-1 p-2 border-bottom d-flex flex-column" id="hTFileSection">
<label style={{fontSize: "1rem"}}>Files</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()}>New File</button> <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">Open File</label> <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) => { <input title="open file" type="file" id="openFileInput" onChange={(event) => {
event.stopPropagation() event.stopPropagation()
plugin.verticalIcons.select('filePanel') plugin.verticalIcons.select('filePanel')
uploadFile(event.target) uploadFile(event.target)
}} multiple /> }} multiple />
<button className="btn p-2 border my-1" style={{width: 'fit-content'}} onClick={() => connectToLocalhost()}>Connect to Localhost</button> <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">Load From</label> <label className="pt-2"><FormattedMessage id='home.loadFrom' defaultMessage='Load From' /></label>
<div className="d-flex"> <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="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" data-id="landingPageImportFromGistButton" onClick={() => importFromGist()}>Gist</button>

@ -1,24 +1,31 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
import React from 'react' import React from 'react'
import { FormattedMessage } from 'react-intl'
function HomeTabScamAlert () { function HomeTabScamAlert () {
return ( return (
<div className="" id="hTScamAlertSection"> <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"> <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"> <span className="pl-4 mt-2">
<i className="pr-2 text-danger fas fa-exclamation-triangle"></i> <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>
<span className="pl-4 mt-1"> <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>
<span className="pl-4 mt-1"> <span className="pl-4 mt-1">
Beware of online videos promoting "liquidity front runner bots": <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">Learn more</a> <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>
<span className="pl-4 mt-1"> <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> </span>
</div> </div>
</div> </div>

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

Loading…
Cancel
Save