add some settings locale message

pull/5370/head
drafish 3 years ago
parent d59eb4c511
commit a40b441e91
  1. 11
      apps/remix-ide/src/app/tabs/locales/en-US.js
  2. 11
      apps/remix-ide/src/app/tabs/locales/zh-CN.js
  3. 19
      libs/remix-ui/settings/src/lib/github-settings.tsx
  4. 11
      libs/remix-ui/settings/src/lib/remix-ui-settings.tsx

@ -7,13 +7,18 @@ export default {
'settings.wordWrapText': 'Word wrap in editor', 'settings.wordWrapText': 'Word wrap in editor',
'settings.enablePersonalModeText': ' Enable Personal Mode for web3 provider. Transaction sent over Web3 will use the web3.personal API.\n', 'settings.enablePersonalModeText': ' Enable Personal Mode for web3 provider. Transaction sent over Web3 will use the web3.personal API.\n',
'settings.warnText': 'Be sure the endpoint is opened before enabling it. \nThis mode allows a user to provide a passphrase in the Remix interface without having to unlock the account. Although this is very convenient, you should completely trust the backend you are connected to (Geth, Parity, ...). Remix never persists any passphrase'.split('\n').map(s => s.trim()).join(' '), 'settings.warnText': 'Be sure the endpoint is opened before enabling it. \nThis mode allows a user to provide a passphrase in the Remix interface without having to unlock the account. Although this is very convenient, you should completely trust the backend you are connected to (Geth, Parity, ...). Remix never persists any passphrase'.split('\n').map(s => s.trim()).join(' '),
'settings.gitAccessTokenTitle': 'GitHub Access Token', 'settings.githubTitle': 'GitHub Credentials',
'settings.gitAccessTokenText': 'Manage the access token used to publish to Gist and retrieve GitHub contents.', 'settings.githubText': 'Manage your GitHub credentials used to publish to Gist and retrieve GitHub contents.',
'settings.gitAccessTokenText2': 'Go to github token page (link below) to create a new token and save it in Remix. Make sure this token has only \'create gist\' permission.', 'settings.githubText2': 'Go to github token page (link below) to create a new token and save it in Remix. Make sure this token has only \'create gist\' permission.',
'settings.etherscanTokenTitle': 'EtherScan Access Token',
'settings.etherscanAccessTokenText': 'Manage the api key used to interact with Etherscan.',
'settings.etherscanAccessTokenText2': 'Go to Etherscan api key page (link below) to create a new api key and save it in Remix.',
'settings.save': 'Save', 'settings.save': 'Save',
'settings.remove': 'Remove', 'settings.remove': 'Remove',
'settings.themes': 'Themes', 'settings.themes': 'Themes',
'settings.locales': 'Lanaguage', 'settings.locales': 'Lanaguage',
'settings.swarm': 'Swarm Settings',
'settings.ipfs': 'IPFS Settings',
'filePanel.displayName': 'File explorer', 'filePanel.displayName': 'File explorer',
'filePanel.workspace': 'Workspaces', 'filePanel.workspace': 'Workspaces',

@ -7,13 +7,18 @@ export default {
'settings.wordWrapText': '文本换行', 'settings.wordWrapText': '文本换行',
'settings.enablePersonalModeText': '为web3提供器启用私有模式. 通过Web3发送的交易将使用web3.personal API.\n', 'settings.enablePersonalModeText': '为web3提供器启用私有模式. 通过Web3发送的交易将使用web3.personal API.\n',
'settings.warnText': '在启用之前请确认访问端结点已经开放. \n此模式允许在Remix界面中提供密码而无需解锁账号. 虽然这很方便,但你应当完全信任所连接的后端节点 (Geth, Parity, ...). Remix不会持久化保存任何密码.'.split('\n').map(s => s.trim()).join(' '), 'settings.warnText': '在启用之前请确认访问端结点已经开放. \n此模式允许在Remix界面中提供密码而无需解锁账号. 虽然这很方便,但你应当完全信任所连接的后端节点 (Geth, Parity, ...). Remix不会持久化保存任何密码.'.split('\n').map(s => s.trim()).join(' '),
'settings.gitAccessTokenTitle': 'Github 访问 Token', 'settings.githubTitle': 'Github 认证信息',
'settings.gitAccessTokenText': '管理用于发布到Gist以及读取Github内容的访问token.', 'settings.githubText': '管理用于发布到 Gist 以及读取 Github 内容的 GitHub 认证信息.',
'settings.gitAccessTokenText2': '前往 github (参见下方链接) 创建一个新的token,然后保存到Remix中. 确保这个token只有 \'create gist\' 权限.', 'settings.githubText2': '前往 github (参见下方链接) 创建一个新的token,然后保存到Remix中. 确保这个token只有 \'create gist\' 权限.',
'settings.etherscanTokenTitle': 'EtherScan 访问 Token',
'settings.etherscanAccessTokenText': '管理用于与Etherscan交互的api密钥.',
'settings.etherscanAccessTokenText2': '前往 Etherscan api 密钥页面 (参见下方链接),创建一个新的api密钥并保存到Remix中.',
'settings.save': '保存', 'settings.save': '保存',
'settings.remove': '删除', 'settings.remove': '删除',
'settings.themes': '主题', 'settings.themes': '主题',
'settings.locales': '语言', 'settings.locales': '语言',
'settings.swarm': 'Swarm 设置',
'settings.ipfs': 'IPFS 设置',
'filePanel.displayName': '文件浏览器', 'filePanel.displayName': '文件浏览器',
'filePanel.workspace': '工作空间', 'filePanel.workspace': '工作空间',

@ -1,11 +1,13 @@
import { CopyToClipboard } from '@remix-ui/clipboard' import { CopyToClipboard } from '@remix-ui/clipboard'
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { FormattedMessage, useIntl } from 'react-intl'
import { GithubSettingsProps } from '../types' import { GithubSettingsProps } from '../types'
export function GithubSettings (props: GithubSettingsProps) { export function GithubSettings (props: GithubSettingsProps) {
const [githubToken, setGithubToken] = useState<string>("") const [githubToken, setGithubToken] = useState<string>("")
const [githubUserName, setGithubUsername] = useState<string>("") const [githubUserName, setGithubUsername] = useState<string>("")
const [githubEmail, setGithubEmail] = useState<string>("") const [githubEmail, setGithubEmail] = useState<string>("")
const intl = useIntl()
useEffect(() => { useEffect(() => {
if (props.config) { if (props.config) {
@ -46,9 +48,14 @@ export function GithubSettings (props: GithubSettingsProps) {
return ( return (
<div className="border-top"> <div className="border-top">
<div className="card-body pt-3 pb-2"> <div className="card-body pt-3 pb-2">
<h6 className="card-title">GitHub Credentials</h6> <h6 className="card-title"><FormattedMessage id='settings.githubTitle' defaultMessage='GitHub Credentials' /></h6>
<p className="mb-1">Manage your GitHub credentials used to publish to Gist and retrieve GitHub contents.</p> <p className="mb-1"><FormattedMessage id='settings.githubText' defaultMessage='Manage your GitHub credentials used to publish to Gist and retrieve GitHub contents.' /></p>
<p className="">Go to github token page (link below) to create a new token and save it in Remix. Make sure this token has only \'create gist\' permission.</p> <p className="">
<FormattedMessage
id='settings.githubText2'
defaultMessage="Go to github token page (link below) to create a new token and save it in Remix. Make sure this token has only \'create gist\' permission."
/>
</p>
<p className="mb-1"><a className="text-primary" target="_blank" href="https://github.com/settings/tokens">https://github.com/settings/tokens</a></p> <p className="mb-1"><a className="text-primary" target="_blank" href="https://github.com/settings/tokens">https://github.com/settings/tokens</a></p>
<div> <div>
<label>TOKEN:</label> <label>TOKEN:</label>
@ -70,8 +77,10 @@ export function GithubSettings (props: GithubSettingsProps) {
<div className="text-secondary mb-0 h6"> <div className="text-secondary mb-0 h6">
<input id="githubemail" data-id="settingsTabGithubEmail" type="text" className="form-control" onChange={(e) => handleChangeEmailState(e)} value={ githubEmail } /> <input id="githubemail" data-id="settingsTabGithubEmail" type="text" className="form-control" onChange={(e) => handleChangeEmailState(e)} value={ githubEmail } />
<div className="d-flex justify-content-end pt-2"> <div className="d-flex justify-content-end pt-2">
<input className="btn btn-sm btn-primary ml-2" id="savegisttoken" data-id="settingsTabSaveGistToken" onClick={saveGithubToken} value="Save" type="button" disabled={githubToken === ''}></input> <input className="btn btn-sm btn-primary ml-2" id="savegisttoken" data-id="settingsTabSaveGistToken" onClick={saveGithubToken} value={intl.formatMessage({id: 'settings.save', defaultMessage: 'Save'})} type="button" disabled={githubToken === ''}></input>
<button className="btn btn-sm btn-secondary ml-2" id="removegisttoken" data-id="settingsTabRemoveGistToken" title="Delete GitHub Credentials" onClick={removeToken}>Remove</button> <button className="btn btn-sm btn-secondary ml-2" id="removegisttoken" data-id="settingsTabRemoveGistToken" title="Delete GitHub Credentials" onClick={removeToken}>
<FormattedMessage id='settings.remove' defaultMessage='Remove' />
</button>
</div> </div>
</div> </div>
</div> </div>

@ -37,7 +37,6 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
const [ipfsProjectSecret, setipfsProjectSecret] = useState('') const [ipfsProjectSecret, setipfsProjectSecret] = useState('')
const intl = useIntl() const intl = useIntl()
const initValue = () => { const initValue = () => {
const metadataConfig = props.config.get('settings/generate-contract-metadata') const metadataConfig = props.config.get('settings/generate-contract-metadata')
if (metadataConfig === undefined || metadataConfig === null) generateContractMetadat(props.config, true, dispatch) if (metadataConfig === undefined || metadataConfig === null) generateContractMetadat(props.config, true, dispatch)
@ -221,9 +220,9 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
const token = (type: string) => ( const token = (type: string) => (
<div className="border-top"> <div className="border-top">
<div className="card-body pt-3 pb-2"> <div className="card-body pt-3 pb-2">
<h6 className="card-title"><FormattedMessage id='settings.gitAccessTokenTitle' defaultMessage={ labels[type].title } /></h6> <h6 className="card-title"><FormattedMessage id='settings.etherscanTokenTitle' defaultMessage={ labels[type].title } /></h6>
<p className="mb-1"><FormattedMessage id='settings.gitAccessTokenText' defaultMessage={ labels[type].message1 } /></p> <p className="mb-1"><FormattedMessage id='settings.etherscanAccessTokenText' defaultMessage={ labels[type].message1 } /></p>
<p className=""><FormattedMessage id='settings.gitAccessTokenText2' defaultMessage={ labels[type].message2 } /></p> <p className=""><FormattedMessage id='settings.etherscanAccessTokenText2' defaultMessage={ labels[type].message2 } /></p>
<p className="mb-1"><a className="text-primary" target="_blank" href={labels[type].link}>{ labels[type].link }</a></p> <p className="mb-1"><a className="text-primary" target="_blank" href={labels[type].link}>{ labels[type].link }</a></p>
<div className=""><label>TOKEN:</label> <div className=""><label>TOKEN:</label>
<div className="text-secondary mb-0 h6"> <div className="text-secondary mb-0 h6">
@ -262,7 +261,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
const swarmSettings = () => ( const swarmSettings = () => (
<div className="border-top"> <div className="border-top">
<div className="card-body pt-3 pb-2"> <div className="card-body pt-3 pb-2">
<h6 className="card-title">{ swarmSettingsTitle }</h6> <h6 className="card-title"><FormattedMessage id='settings.swarm' defaultMessage={ swarmSettingsTitle } /></h6>
<div className="pt-2 mb-1"><label>PRIVATE BEE ADDRESS:</label> <div className="pt-2 mb-1"><label>PRIVATE BEE ADDRESS:</label>
<div className="text-secondary mb-0 h6"> <div className="text-secondary mb-0 h6">
<input id="swarmprivatebeeaddress" data-id="settingsPrivateBeeAddress" className="form-control" onChange={handleSavePrivateBeeAddress} value={ privateBeeAddress } /> <input id="swarmprivatebeeaddress" data-id="settingsPrivateBeeAddress" className="form-control" onChange={handleSavePrivateBeeAddress} value={ privateBeeAddress } />
@ -326,7 +325,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
const ipfsSettings = () => ( const ipfsSettings = () => (
<div className="border-top"> <div className="border-top">
<div className="card-body pt-3 pb-2"> <div className="card-body pt-3 pb-2">
<h6 className="card-title">{ ipfsSettingsText }</h6> <h6 className="card-title"><FormattedMessage id='settings.ipfs' defaultMessage={ ipfsSettingsText } /></h6>
<div className="pt-2 mb-1"><label>IPFS HOST:</label> <div className="pt-2 mb-1"><label>IPFS HOST:</label>
<div className="text-secondary mb-0 h6"> <div className="text-secondary mb-0 h6">
<input placeholder='e.g. ipfs.infura.io' id="settingsIpfsUrl" data-id="settingsIpfsUrl" className="form-control" onChange={handleSaveIpfsUrl} value={ ipfsUrl } /> <input placeholder='e.g. ipfs.infura.io' id="settingsIpfsUrl" data-id="settingsIpfsUrl" className="form-control" onChange={handleSaveIpfsUrl} value={ ipfsUrl } />

Loading…
Cancel
Save