diff --git a/src/locales/en/common.json b/src/locales/en/common.json index 334102889..3d05e6d57 100644 --- a/src/locales/en/common.json +++ b/src/locales/en/common.json @@ -1320,7 +1320,8 @@ "alertCriticalDapp": "The QR code provided is not from {{dappName}}.", "alertSuccess": "{{dappName}} connected", "codeInputPlaceholder": "wc: …", - "alertCriticalQRcode": "The QR code provided is not from {{dappName}}." + "alertCriticalQRcode": "The QR code provided is not from {{dappName}}.", + "alertInvalid": "Invalid code" }, "detaildApp": { "spinnerLabel": "Listening for actions…", diff --git a/src/services/walletConnectInterceptor.ts b/src/services/walletConnectInterceptor.ts index e02602b78..297e7a204 100644 --- a/src/services/walletConnectInterceptor.ts +++ b/src/services/walletConnectInterceptor.ts @@ -5,6 +5,7 @@ import {AuthClientTypes} from '@walletconnect/auth-client'; import {Web3WalletTypes} from '@walletconnect/web3wallet'; import {PairingTypes, SessionTypes} from '@walletconnect/types'; import {WC_URI_PATTERN} from 'utils/constants'; +import {i18n} from '../../i18n.config'; const URI_REGEX = new RegExp(WC_URI_PATTERN); class WalletConnectInterceptor { @@ -25,7 +26,9 @@ class WalletConnectInterceptor { validateURI(uri: string) { // TODO: Get crowdin key for this - return URI_REGEX.test(uri) ? undefined : 'Invalid code'; + return URI_REGEX.test(uri) + ? undefined + : i18n.t('modal.dappConnect.validation.alertInvalid'); } subscribeConnectProposal(