diff --git a/apps/contract-verification/src/app/app.tsx b/apps/contract-verification/src/app/app.tsx index 0ea4332543d..85ebbfb19bc 100644 --- a/apps/contract-verification/src/app/app.tsx +++ b/apps/contract-verification/src/app/app.tsx @@ -13,6 +13,7 @@ import { CompilerAbstract } from '@remix-project/remix-solidity' import { useLocalStorage } from './hooks/useLocalStorage' import { getVerifier } from './Verifiers' import { ContractDropdownSelection } from './components/ContractDropdown' +import { IntlProvider } from 'react-intl' const plugin = new ContractVerificationPluginClient() @@ -32,11 +33,25 @@ const App = () => { const [proxyAddressError, setProxyAddressError] = useState('') const [abiEncodedConstructorArgs, setAbiEncodedConstructorArgs] = useState('') const [abiEncodingError, setAbiEncodingError] = useState('') + const [locale, setLocale] = useState<{ code: string; messages: any }>({ + code: 'en', + messages: {} + }) const timer = useRef(null) useEffect(() => { plugin.internalEvents.on('verification_activated', () => { + + // @ts-ignore + plugin.call('locale', 'currentLocale').then((locale: any) => { + setLocale(locale) + }) + + // @ts-ignore + plugin.on('locale', 'localeChanged', (locale: any) => { + setLocale(locale) + }) // Fetch compiler artefacts initially plugin.call('compilerArtefacts' as any, 'getAllCompilerAbstracts').then((obj: any) => { setCompilationOutput(obj) @@ -143,11 +158,13 @@ const App = () => { }, [submittedContracts]) return ( - - - - - + + + + + + + ) } diff --git a/apps/contract-verification/src/app/components/AccordionReceipt.tsx b/apps/contract-verification/src/app/components/AccordionReceipt.tsx index 68332d09bb0..944cc370463 100644 --- a/apps/contract-verification/src/app/components/AccordionReceipt.tsx +++ b/apps/contract-verification/src/app/components/AccordionReceipt.tsx @@ -97,32 +97,32 @@ const ReceiptsBody = ({ receipts }: { receipts: VerificationReceipt[] }) => { className="list-group-item d-flex flex-row align-items-center" > - - {['verified', 'partially verified', 'already verified'].includes(receipt.status) ? - : - receipt.status === 'fully verified' ? - : - receipt.status === 'failed' ? - : - ['pending', 'awaiting implementation verification'].includes(receipt.status) ? - : - - } - - -
+ placement="top" + tooltipClasses=" text-break" + tooltipTextClasses="text-capitalize" + tooltipText={`Status: ${receipt.status}${receipt.message ? `, Message: ${receipt.message}` : ''}`} + > + + {['verified', 'partially verified', 'already verified'].includes(receipt.status) ? + : + receipt.status === 'fully verified' ? + : + receipt.status === 'failed' ? + : + ['pending', 'awaiting implementation verification'].includes(receipt.status) ? + : + + } + + +
{receipt.verifierInfo.name}
{!!receipt.lookupUrl && receipt.verifierInfo.name === 'Blockscout' ? : - !!receipt.lookupUrl && + !!receipt.lookupUrl && }
diff --git a/apps/contract-verification/src/app/components/ConfigInput.tsx b/apps/contract-verification/src/app/components/ConfigInput.tsx index 0737840115d..9f08ab42c5b 100644 --- a/apps/contract-verification/src/app/components/ConfigInput.tsx +++ b/apps/contract-verification/src/app/components/ConfigInput.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react' import { CustomTooltip } from '@remix-ui/helper' +import { FormattedMessage, useIntl } from 'react-intl' interface ConfigInputProps { label: string @@ -13,6 +14,7 @@ interface ConfigInputProps { export const ConfigInput: React.FC = ({ label, id, secret, initialValue, saveResult }) => { const [value, setValue] = useState(initialValue) const [enabled, setEnabled] = useState(false) + const intl = useIntl() // Reset state when initialValue changes useEffect(() => { @@ -42,7 +44,7 @@ export const ConfigInput: React.FC = ({ label, id, secret, ini type={secret ? 'password' : 'text'} className={`form-control small w-100 ${!enabled ? 'bg-transparent pl-0 border-0' : ''}`} id={id} - placeholder={`Add ${label}`} + placeholder={intl.formatMessage({ id: "contract-verification.configInputPlaceholder" }, { label })} value={value} onChange={(e) => setValue(e.target.value)} disabled={!enabled} @@ -51,10 +53,10 @@ export const ConfigInput: React.FC = ({ label, id, secret, ini { enabled ? ( <> ) : ( diff --git a/apps/contract-verification/src/app/components/ConstructorArguments.tsx b/apps/contract-verification/src/app/components/ConstructorArguments.tsx index e2a4239eaae..46fa9822a7b 100644 --- a/apps/contract-verification/src/app/components/ConstructorArguments.tsx +++ b/apps/contract-verification/src/app/components/ConstructorArguments.tsx @@ -3,6 +3,7 @@ import { ethers } from 'ethers' import { AppContext } from '../AppContext' import { ContractDropdownSelection } from './ContractDropdown' +import { FormattedMessage } from 'react-intl' interface ConstructorArgumentsProps { abiEncodedConstructorArgs: string @@ -102,7 +103,9 @@ export const ConstructorArguments: React.FC = ({ abiE
setToggleRawInput(!toggleRawInput)} />
{toggleRawInput ? ( @@ -122,7 +125,10 @@ export const ConstructorArguments: React.FC = ({ abiE {abiEncodedConstructorArgs && (