diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index 7ed77d716e..ff49681d2e 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -20,5 +20,15 @@ "udapp.deployedContracts": "Deployed Contracts", "udapp.deployAndRunClearInstances": "Clear instances list and reset recorder", "udapp.deployAndRunNoInstanceText": "Currently you have no contract instances to interact with.", - "udapp.transactionsRecorded": "Transactions recorded" + "udapp.transactionsRecorded": "Transactions recorded", + "udapp.transactionsCountTooltip": "The number of recorded transactions", + "udapp.transactionSaveTooltip1": "No transactions to save", + "udapp.transactionSaveTooltip2": "Save {count} transaction as scenario file", + "udapp.transactionSaveTooltip3": "Save {count} transactions as scenario file", + "udapp.infoRecorderTooltip": "Save transactions (deployed contracts and function executions) {br}and replay them in another environment e.g Transactions created {br}in Remix VM can be replayed in the Injected Provider.", + "udapp.livemodeRecorderTooltip": "If contracts are updated after recording transactions,{br} checking this box will run recorded transactions {br}with the latest copy of the compiled contracts", + "udapp.livemodeRecorderLabel": "Run transactions using the latest compilation result", + "udapp.runRecorderTooltip": "Run transaction(s) from the current scenario file", + "udapp.save": "Save", + "udapp.run": "Run" } diff --git a/apps/remix-ide/src/app/tabs/locales/zh/udapp.json b/apps/remix-ide/src/app/tabs/locales/zh/udapp.json index bdec6b96e0..7c920d0094 100644 --- a/apps/remix-ide/src/app/tabs/locales/zh/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/zh/udapp.json @@ -20,5 +20,15 @@ "udapp.deployedContracts": "已部署的合约", "udapp.deployAndRunClearInstances": "清空合约实例并重置交易记录", "udapp.deployAndRunNoInstanceText": "当前您没有可交互的合约实例.", - "udapp.transactionsRecorded": "已记录的交易" + "udapp.transactionsRecorded": "已记录的交易", + "udapp.transactionsCountTooltip": "已记录的交易数", + "udapp.transactionSaveTooltip1": "没有可保存的交易", + "udapp.transactionSaveTooltip2": "将 {count} 笔交易保存到一个场景文件", + "udapp.transactionSaveTooltip3": "将 {count} 笔交易保存到一个场景文件", + "udapp.infoRecorderTooltip": "保存交易 (合约部署和方法执行) {br}然后在另一个环境中回放,比如在 Remix VM {br}创建的交易可以在 Injected Provider 中回放。", + "udapp.livemodeRecorderTooltip": "如果记录交易后合约有更新,{br}选中这个复选框就会以最新的{br}合约编译结果执行已记录的交易", + "udapp.livemodeRecorderLabel": "用最新的编译结果执行交易", + "udapp.runRecorderTooltip": "从当前场景文件中执行交易", + "udapp.save": "保存", + "udapp.run": "执行" } diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index 63e7a77598..6ce1ac3009 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -1,6 +1,6 @@ // eslint-disable-next-line no-use-before-define import React, {useRef, useState, useEffect} from 'react' -import { FormattedMessage } from 'react-intl' +import { FormattedMessage, useIntl } from 'react-intl' import { RecorderProps } from '../types' import { CustomTooltip } from '@remix-ui/helper' @@ -8,6 +8,8 @@ export function RecorderUI (props: RecorderProps) { const inputLive = useRef() const [toggleExpander, setToggleExpander] = useState(false) const [enableRunButton, setEnableRunButton] = useState(true) + const intl = useIntl() + const triggerRecordButton = () => { props.storeScenario(props.scenarioPrompt) } @@ -38,7 +40,7 @@ export function RecorderUI (props: RecorderProps) { placement={'right'} tooltipClasses="text-nowrap" tooltipId="recordedTransactionsCounttooltip" - tooltipText={'The number of recorded transactions'} + tooltipText={} >
{props.count}
@@ -46,7 +48,7 @@ export function RecorderUI (props: RecorderProps) { placement={'right'} tooltipClasses="text-wrap" tooltipId="info-recorder" - tooltipText={Save transactions (deployed contracts and function executions)
and replay them in another environment e.g Transactions created
in Remix VM can be replayed in the Injected Provider.
} + tooltipText={ }} />} > @@ -64,9 +66,11 @@ export function RecorderUI (props: RecorderProps) { placement={'right'} tooltipClasses="text-wrap" tooltipId="tooltip-livemode-recorder" - tooltipText={If contracts are updated after recording transactions,
checking this box will run recorded transactions
with the latest copy of the compiled contracts
} + tooltipText={ }} />} > - +
@@ -75,14 +79,14 @@ export function RecorderUI (props: RecorderProps) { tooltipClasses="text-nowrap" tooltipId="remixUdappTransactionSavetooltip" tooltipText={ - props.count === 0 ? 'No transactions to save' - : props.count === 1 ? `Save ${props.count} transaction as scenario file` - : `Save ${props.count} transactions as scenario file` + props.count === 0 ? intl.formatMessage({ id: 'udapp.transactionSaveTooltip1' }) + : props.count === 1 ? intl.formatMessage({ id: 'udapp.transactionSaveTooltip2' }, { count: props.count }) + : intl.formatMessage({ id: 'udapp.transactionSaveTooltip3' }, { count: props.count }) } > @@ -90,11 +94,11 @@ export function RecorderUI (props: RecorderProps) { placement={'right'} tooltipClasses="text-nowrap" tooltipId="tooltip-run-recorder" - tooltipText="Run transaction(s) from the current scenario file" + tooltipText={} >