From 39f7988856508b3404ce1b2b1b00d55fca5517e4 Mon Sep 17 00:00:00 2001 From: drafish Date: Mon, 14 Aug 2023 10:00:28 +0800 Subject: [PATCH] patch en locale messages for udapp and filePanel --- .../app/providers/custom-vm-fork-provider.tsx | 13 +++-- .../app/providers/external-http-provider.tsx | 48 +++++++++++------ .../src/app/providers/foundry-provider.tsx | 17 ++++-- .../src/app/providers/ganache-provider.tsx | 17 ++++-- .../src/app/providers/hardhat-provider.tsx | 17 ++++-- .../src/app/tabs/locales/en/filePanel.json | 3 +- .../src/app/tabs/locales/en/udapp.json | 22 +++++++- .../src/lib/components/custom-dropdown.tsx | 53 +++++++++++-------- 8 files changed, 132 insertions(+), 58 deletions(-) diff --git a/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx b/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx index 700456f2ba..d25208bbb9 100644 --- a/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx +++ b/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx @@ -1,4 +1,5 @@ import React, {useRef} from 'react' // eslint-disable-line +import {FormattedMessage} from 'react-intl' import * as packageJson from '../../../../../package.json' import {AppModal, ModalTypes} from '@remix-ui/app' import {BasicVMProvider} from './vm-provider' @@ -32,13 +33,19 @@ export class CustomForkVMProvider extends BasicVMProvider { const body = () => { return (
- Please provide information about the custom fork. If the node URL is not provided, the VM will start with an empty state. + + +
- +
- +
- Note: To use Geth & https://remix.ethereum.org, configure it to allow requests from Remix:(see{' '} - - Geth Docs on rpc server - - )
geth --http --http.corsdomain https://remix.ethereum.org
+ ( + + {chunks} + + ) + }} + /> +
geth --http --http.corsdomain https://remix.ethereum.org

- To run Remix & a local Geth test node, use this command: (see{' '} - - Geth Docs on Dev mode - - ) + ( + + {chunks} + + ) + }} + />
geth --http --http.corsdomain="{window.origin}" --http.api web3,eth,debug,personal,net --vmdebug --datadir {thePath} --dev console


- WARNING: It is not safe to use the --http.corsdomain flag with a wildcard: --http.corsdomain * + {chunks}}} />

- For more info:{' '} - - Remix Docs on External HTTP Provider - + ( + + {chunks} + + ) + }} + />

External HTTP Provider Endpoint diff --git a/apps/remix-ide/src/app/providers/foundry-provider.tsx b/apps/remix-ide/src/app/providers/foundry-provider.tsx index 3ec4ee70ec..47a3c2849f 100644 --- a/apps/remix-ide/src/app/providers/foundry-provider.tsx +++ b/apps/remix-ide/src/app/providers/foundry-provider.tsx @@ -1,5 +1,6 @@ import * as packageJson from '../../../../../package.json' import React from 'react' // eslint-disable-line +import {FormattedMessage} from 'react-intl' import {AbstractProvider} from './abstract-provider' const profile = { @@ -20,7 +21,7 @@ export class FoundryProvider extends AbstractProvider { return (
{' '} - Note: To run Anvil on your system, run: +
curl -L https://foundry.paradigm.xyz | bash
@@ -28,10 +29,16 @@ export class FoundryProvider extends AbstractProvider { anvil
- For more info, visit:{' '} - - Foundry Documentation - + ( + + {chunks} + + ) + }} + />
Anvil JSON-RPC Endpoint:
diff --git a/apps/remix-ide/src/app/providers/ganache-provider.tsx b/apps/remix-ide/src/app/providers/ganache-provider.tsx index b8cb1488b5..79bac4b853 100644 --- a/apps/remix-ide/src/app/providers/ganache-provider.tsx +++ b/apps/remix-ide/src/app/providers/ganache-provider.tsx @@ -1,5 +1,6 @@ import * as packageJson from '../../../../../package.json' import React from 'react' // eslint-disable-line +import {FormattedMessage} from 'react-intl' import {AbstractProvider} from './abstract-provider' const profile = { @@ -20,7 +21,7 @@ export class GanacheProvider extends AbstractProvider { return (
{' '} - Note: To run Ganache on your system, run: +
yarn global add ganache
@@ -28,10 +29,16 @@ export class GanacheProvider extends AbstractProvider { ganache
- For more info, visit:{' '} - - Ganache Documentation - + ( + + {chunks} + + ) + }} + />
Ganache JSON-RPC Endpoint:
diff --git a/apps/remix-ide/src/app/providers/hardhat-provider.tsx b/apps/remix-ide/src/app/providers/hardhat-provider.tsx index 79b02a120f..0dfe1c70af 100644 --- a/apps/remix-ide/src/app/providers/hardhat-provider.tsx +++ b/apps/remix-ide/src/app/providers/hardhat-provider.tsx @@ -1,5 +1,6 @@ import * as packageJson from '../../../../../package.json' import React from 'react' // eslint-disable-line +import {FormattedMessage} from 'react-intl' import {AbstractProvider} from './abstract-provider' const profile = { @@ -20,15 +21,21 @@ export class HardhatProvider extends AbstractProvider { return (
{' '} - Note: To run Hardhat network node on your system, go to hardhat project folder and run command: +
npx hardhat node
- For more info, visit:{' '} - - Hardhat Documentation - + ( + + {chunks} + + ) + }} + />
Hardhat JSON-RPC Endpoint:
diff --git a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json index 493239b44c..cdc270f480 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/filePanel.json +++ b/apps/remix-ide/src/app/tabs/locales/en/filePanel.json @@ -118,5 +118,6 @@ "filePanel.movingFileFailed": "Moving File Failed", "filePanel.movingFileFailedMsg": "Unexpected error while moving file: {src}", "filePanel.movingFolderFailed": "Moving Folder Failed", - "filePanel.movingFolderFailedMsg": "Unexpected error while moving folder: {src}" + "filePanel.movingFolderFailedMsg": "Unexpected error while moving folder: {src}", + "filePanel.workspaceActions": "Workspace actions" } 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 cce5ae9d53..d2e2af9193 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -128,6 +128,24 @@ "udapp.maxTransactionFee": "Max transaction fee", "udapp.mainnetText3": "Do not show this warning again.", - "udapp._comment_run-tab.tsx": "/libs/remix-ui/run-tab/src/lib/run-tab.tsx", - "udapp.gasEstimationPromptText": "Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?" + "udapp._comment_run-tab.tsx": "libs/remix-ui/run-tab/src/lib/run-tab.tsx", + "udapp.gasEstimationPromptText": "Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?", + + "udapp._comment_custom-dropdown.tsx": "libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx", + "udapp.enterProxyAddress": "Enter Proxy Address", + + "udapp._comment_provider": "apps/remix-ide/src/app/providers", + "udapp.customVmForkProviderText": "Please provide information about the custom fork. If the node URL is not provided, the VM will start with an empty state.", + "udapp.nodeUrl": "Node URL", + "udapp.blockNumber": "Block number (or \"latest\")", + "udapp.externalHttpProviderText1": "Note: To use Geth & https://remix.ethereum.org, configure it to allow requests from Remix:(see Geth Docs on rpc server)", + "udapp.externalHttpProviderText2": "To run Remix & a local Geth test node, use this command: (see Geth Docs on Dev mode)", + "udapp.externalHttpProviderText3": "WARNING: It is not safe to use the --http.corsdomain flag with a wildcard: --http.corsdomain *", + "udapp.externalHttpProviderText4": "For more info: Remix Docs on External HTTP Provider", + "udapp.foundryProviderText1": "Note: To run Anvil on your system, run:", + "udapp.foundryProviderText2": "For more info, visit: Foundry Documentation", + "udapp.ganacheProviderText1": "Note: To run Ganache on your system, run:", + "udapp.ganacheProviderText2": "For more info, visit: Ganache Documentation", + "udapp.hardhatProviderText1": "Note: To run Hardhat network node on your system, go to hardhat project folder and run command:", + "udapp.hardhatProviderText2": "For more info, visit: Hardhat Documentation" } diff --git a/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx b/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx index c2d08a345d..2fa0ed37c8 100644 --- a/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx +++ b/libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx @@ -1,6 +1,7 @@ // The forwardRef is important!! import React, {Ref} from 'react' +import {FormattedMessage, useIntl} from 'react-intl' import {CustomTooltip} from '@remix-ui/helper' // Dropdown needs access to the DOM node in order to position the Menu @@ -66,7 +67,12 @@ export const CustomIconsToggle = React.forwardRef( data-id="workspaceMenuDropdown" > {icon && ( - + } + > )} @@ -118,29 +124,32 @@ export const ProxyAddressToggle = React.forwardRef( onChange: (e: React.ChangeEvent) => void }, ref: Ref - ) => ( -
{ - e.preventDefault() - onClick(e) - }} - className={'d-flex ' + className.replace('dropdown-toggle', '')} - data-id="toggleProxyAddressDropdown" - > - { + ) => { + const intl = useIntl() + return ( +
{ e.preventDefault() - onChange(e) + onClick(e) }} - className="udapp_input form-control" - value={address} - placeholder="Enter Proxy Address" - style={{width: '100%'}} - data-id="ERC1967AddressInput" - /> -
- ) + className={'d-flex ' + className.replace('dropdown-toggle', '')} + data-id="toggleProxyAddressDropdown" + > + { + e.preventDefault() + onChange(e) + }} + className="udapp_input form-control" + value={address} + placeholder={intl.formatMessage({id: 'udapp.enterProxyAddress'})} + style={{width: '100%'}} + data-id="ERC1967AddressInput" + /> +
+ ) + } ) export const ProxyDropdownMenu = React.forwardRef(