diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-09 11:03:30 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-09 11:03:30 -0300 |
commit | 7d07f752eb4e6606c83cba6d2bf84369b6fab32f (patch) | |
tree | 77264d98358a4ad965d3da78098b304f0359de62 /packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx | |
parent | 1665cf4f72b831412e5d704d02be5887be090e50 (diff) | |
download | wallet-core-7d07f752eb4e6606c83cba6d2bf84369b6fab32f.tar.xz |
new string added to i18n
Diffstat (limited to 'packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx b/packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx index bc3880ee2..5304b6273 100644 --- a/packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx +++ b/packages/demobank-ui/src/pages/home/WalletWithdrawForm.tsx @@ -19,7 +19,10 @@ import { h, VNode } from "preact"; import { StateUpdater, useEffect, useRef } from "preact/hooks"; import { useBackendContext } from "../../context/backend.js"; import { PageStateType, usePageContext } from "../../context/pageState.js"; -import { useTranslationContext } from "../../context/translation.js"; +import { + InternationalizationAPI, + useTranslationContext, +} from "../../context/translation.js"; import { BackendState } from "../../hooks/backend.js"; import { prepareHeaders, validateAmount } from "../../utils.js"; @@ -91,6 +94,7 @@ export function WalletWithdrawForm({ `${currency}:${submitAmount}`, backend.state, pageStateSetter, + i18n, ); }} /> @@ -113,6 +117,7 @@ async function createWithdrawalCall( amount: string, backendState: BackendState, pageStateSetter: StateUpdater<PageStateType>, + i18n: InternationalizationAPI, ): Promise<void> { if (backendState?.status === "loggedOut") { logger.error("Page has a problem: no credentials found in the state."); @@ -120,7 +125,7 @@ async function createWithdrawalCall( ...prevState, error: { - title: "No credentials given.", + title: i18n.str`No credentials given.`, }, })); return; @@ -147,7 +152,7 @@ async function createWithdrawalCall( ...prevState, error: { - title: `Could not create withdrawal operation`, + title: i18n.str`Could not create withdrawal operation`, description: (error as any).error.description, debug: JSON.stringify(error), }, @@ -163,7 +168,7 @@ async function createWithdrawalCall( ...prevState, error: { - title: `Withdrawal creation gave response error`, + title: i18n.str`Withdrawal creation gave response error`, description: response.error.description, debug: JSON.stringify(response), }, |