Skip to content

Commit

Permalink
[#80] add network param to network related error translation
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzalowski committed Feb 6, 2024
1 parent d848ad2 commit e930ad8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions govtool/frontend/src/context/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions govtool/frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down

0 comments on commit e930ad8

Please sign in to comment.