From e930ad81199552311a3b69005f7a3d65324f6020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Tue, 6 Feb 2024 14:27:55 +0100 Subject: [PATCH] [#80] add network param to network related error translation --- .../src/components/organisms/DelegateTodRepStepOne.tsx | 2 +- govtool/frontend/src/context/wallet.tsx | 6 +++--- govtool/frontend/src/i18n/locales/en.ts | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/govtool/frontend/src/components/organisms/DelegateTodRepStepOne.tsx b/govtool/frontend/src/components/organisms/DelegateTodRepStepOne.tsx index 570dc3cb8..2e333a0c1 100644 --- a/govtool/frontend/src/components/organisms/DelegateTodRepStepOne.tsx +++ b/govtool/frontend/src/components/organisms/DelegateTodRepStepOne.tsx @@ -50,7 +50,7 @@ export const DelegateTodRepStepOne = ({ setStep }: DelegateProps) => { title: t("modals.delegation.title"), message: t("modals.delegation.message"), link: "https://adanordic.com/latest_transactions", - buttonText: "Go to dashboard", + buttonText: t("modals.common.goToDashboard"), onSubmit: () => { navigate(PATHS.dashboard); closeModal(); diff --git a/govtool/frontend/src/context/wallet.tsx b/govtool/frontend/src/context/wallet.tsx index 60b3d4182..46b9bacb0 100644 --- a/govtool/frontend/src/context/wallet.tsx +++ b/govtool/frontend/src/context/wallet.tsx @@ -553,9 +553,9 @@ function CardanoProvider(props: Props) { const network = await enabledApi.getNetworkId(); if (network != NETWORK) { throw new Error( - network == 1 - ? t("errors.tryingConnectToMainnet") - : t("errors.tryingConnectToTestnet") + t("errors.tryingConnectTo", { + network: network == 1 ? "mainnet" : "testnet", + }) ); } setIsMainnet(network == 1); diff --git a/govtool/frontend/src/i18n/locales/en.ts b/govtool/frontend/src/i18n/locales/en.ts index 446d3d332..7afa2d5ea 100644 --- a/govtool/frontend/src/i18n/locales/en.ts +++ b/govtool/frontend/src/i18n/locales/en.ts @@ -143,10 +143,8 @@ export const en = { registeringStakeKey: "Registering stake key", somethingWentWrong: "Something went wrong", useCardano: "useCardano must be used within a CardanoProvider", - tryingConnectToMainnet: - "You are trying to connect with a wallet connected to mainnet. Please adjust your wallet settings to connect to mainnet or select a different wallet.", - tryingConnectToTestnet: - "You are trying to connect with a wallet connected to testnet. Please adjust your wallet settings to connect to testnet or select a different wallet.", + tryingConnectTo: + "You are trying to connect with a wallet connected to {{network}}. Please adjust your wallet settings to connect to {{network}} or select a different wallet.", walletNoCIP30Nor90Support: "Your wallet does not support the required CIP-30 extension, CIP-95.", walletNoCIP30Support: "Your wallet does not support CIP-30 extensions.",