new string added to i18n
This commit is contained in:
parent
1665cf4f72
commit
7d07f752eb
@ -14,36 +14,30 @@
|
|||||||
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Sebastian Javier Marchano (sebasjm)
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { i18n, setupI18n } from "@gnu-taler/taler-util";
|
import { i18n, setupI18n } from "@gnu-taler/taler-util";
|
||||||
import { ComponentChildren, createContext, h, VNode } from "preact";
|
import { ComponentChildren, createContext, h, VNode } from "preact";
|
||||||
import { useContext, useEffect } from "preact/hooks";
|
import { useContext, useEffect } from "preact/hooks";
|
||||||
import { hooks } from "@gnu-taler/web-util/lib/index.browser";
|
import { hooks } from "@gnu-taler/web-util/lib/index.browser";
|
||||||
import { strings } from "../i18n/strings.js";
|
import { strings } from "../i18n/strings.js";
|
||||||
|
|
||||||
|
|
||||||
|
export type InternationalizationAPI = typeof i18n
|
||||||
|
|
||||||
interface Type {
|
interface Type {
|
||||||
lang: string;
|
lang: string;
|
||||||
supportedLang: { [id in keyof typeof supportedLang]: string };
|
supportedLang: { [id in keyof typeof supportedLang]: string };
|
||||||
changeLanguage: (l: string) => void;
|
changeLanguage: (l: string) => void;
|
||||||
i18n: typeof i18n;
|
i18n: InternationalizationAPI;
|
||||||
isSaved: boolean;
|
isSaved: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const supportedLang = {
|
const supportedLang = {
|
||||||
es: "Español [es]",
|
es: "Espanol [es]",
|
||||||
ja: "日本語 [ja]",
|
|
||||||
en: "English [en]",
|
en: "English [en]",
|
||||||
fr: "Français [fr]",
|
fr: "Francais [fr]",
|
||||||
de: "Deutsch [de]",
|
de: "Deutsch [de]",
|
||||||
sv: "Svenska [sv]",
|
sv: "Svenska [sv]",
|
||||||
it: "Italiano [it]",
|
it: "Italiane [it]",
|
||||||
// ko: "한국어 [ko]",
|
|
||||||
// ru: "Ру́сский язы́к [ru]",
|
|
||||||
tr: "Türk [tr]",
|
|
||||||
navigator: "Defined by navigator",
|
navigator: "Defined by navigator",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -82,106 +82,141 @@ msgstr ""
|
|||||||
msgid "Register"
|
msgid "Register"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:57
|
#: src/pages/home/PaytoWireTransferForm.tsx:60
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Missing IBAN"
|
msgid "Missing IBAN"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:59
|
#: src/pages/home/PaytoWireTransferForm.tsx:62
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "IBAN should have just uppercased letters and numbers"
|
msgid "IBAN should have just uppercased letters and numbers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:61
|
#: src/pages/home/PaytoWireTransferForm.tsx:64
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Missing subject"
|
msgid "Missing subject"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:63
|
#: src/pages/home/PaytoWireTransferForm.tsx:66
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Missing amount"
|
msgid "Missing amount"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:65
|
#: src/pages/home/PaytoWireTransferForm.tsx:68
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Amount is not valid"
|
msgid "Amount is not valid"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:67
|
#: src/pages/home/PaytoWireTransferForm.tsx:70
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Should be greater than 0"
|
msgid "Should be greater than 0"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:76
|
#: src/pages/home/PaytoWireTransferForm.tsx:79
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Receiver IBAN:"
|
msgid "Receiver IBAN:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:99
|
#: src/pages/home/PaytoWireTransferForm.tsx:102
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Transfer subject:"
|
msgid "Transfer subject:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:120
|
#: src/pages/home/PaytoWireTransferForm.tsx:123
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Amount:"
|
msgid "Amount:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:174
|
#: src/pages/home/PaytoWireTransferForm.tsx:177
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Field(s) missing."
|
msgid "Field(s) missing."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:223
|
#: src/pages/home/PaytoWireTransferForm.tsx:227
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Want to try the raw payto://-format?"
|
msgid "Want to try the raw payto://-format?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:231
|
#: src/pages/home/PaytoWireTransferForm.tsx:235
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Missing payto address"
|
msgid "Missing payto address"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:233
|
#: src/pages/home/PaytoWireTransferForm.tsx:237
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Payto does not follow the pattern"
|
msgid "Payto does not follow the pattern"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:239
|
#: src/pages/home/PaytoWireTransferForm.tsx:243
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Transfer money to account identified by payto:// URI:"
|
msgid "Transfer money to account identified by payto:// URI:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:242
|
#: src/pages/home/PaytoWireTransferForm.tsx:246
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "payto URI:"
|
msgid "payto URI:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:251
|
#: src/pages/home/PaytoWireTransferForm.tsx:255
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "payto address"
|
msgid "payto address"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:275
|
#: src/pages/home/PaytoWireTransferForm.tsx:279
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Send"
|
msgid "Send"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaytoWireTransferForm.tsx:309
|
#: src/pages/home/PaytoWireTransferForm.tsx:314
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Use wire-transfer form?"
|
msgid "Use wire-transfer form?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WalletWithdrawForm.tsx:47
|
#: src/pages/home/PaytoWireTransferForm.tsx:373
|
||||||
|
#, c-format
|
||||||
|
msgid "No credentials found."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/PaytoWireTransferForm.tsx:397
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not create the wire transfer"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/PaytoWireTransferForm.tsx:414
|
||||||
|
#, c-format
|
||||||
|
msgid "Transfer creation gave response error"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/PaytoWireTransferForm.tsx:426
|
||||||
|
#, c-format
|
||||||
|
msgid "Wire transfer created!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WalletWithdrawForm.tsx:50
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Amount to withdraw:"
|
msgid "Amount to withdraw:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WalletWithdrawForm.tsx:81
|
#: src/pages/home/WalletWithdrawForm.tsx:84
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Withdraw"
|
msgid "Withdraw"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WalletWithdrawForm.tsx:128
|
||||||
|
#, c-format
|
||||||
|
msgid "No credentials given."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WalletWithdrawForm.tsx:155
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not create withdrawal operation"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WalletWithdrawForm.tsx:171
|
||||||
|
#, c-format
|
||||||
|
msgid "Withdrawal creation gave response error"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/PaymentOptions.tsx:44
|
#: src/pages/home/PaymentOptions.tsx:44
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Obtain digital cash"
|
msgid "Obtain digital cash"
|
||||||
@ -222,48 +257,88 @@ msgstr ""
|
|||||||
msgid "Use this QR code to withdraw to your mobile wallet:"
|
msgid "Use this QR code to withdraw to your mobile wallet:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/QrCodeSection.tsx:48
|
#: src/pages/home/QrCodeSection.tsx:47
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "this link"
|
msgid "Click %1$s to open your Taler wallet!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:44
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:47
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Confirm Withdrawal"
|
msgid "Confirm Withdrawal"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:49
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:52
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Authorize withdrawal by solving challenge"
|
msgid "Authorize withdrawal by solving challenge"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:52
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:55
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "What is"
|
msgid "What is"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:90
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:94
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Answer is wrong."
|
msgid "Answer is wrong."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:95
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:99
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Confirm"
|
msgid "Confirm"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:108
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:113
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Cancel"
|
msgid "Cancel"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:115
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:120
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid ""
|
msgid ""
|
||||||
"A this point, a %1$s bank would ask for an additional authentication proof "
|
"A this point, a %1$s bank would ask for an additional authentication proof "
|
||||||
"(PIN/TAN, one time password, ..), instead of a simple calculation."
|
"(PIN/TAN, one time password, ..), instead of a simple calculation."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:155
|
||||||
|
#, c-format
|
||||||
|
msgid "\\"No credentials found."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:166
|
||||||
|
#, c-format
|
||||||
|
msgid "No withdrawal ID found."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:201
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not confirm the withdrawal"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:219
|
||||||
|
#, c-format
|
||||||
|
msgid "Withdrawal confirmation gave response error"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:231
|
||||||
|
#, c-format
|
||||||
|
msgid "Withdrawal confirmed!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:294
|
||||||
|
#, c-format
|
||||||
|
msgid "Could not abort the withdrawal."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:311
|
||||||
|
#, c-format
|
||||||
|
msgid "Withdrawal abortion failed."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/WithdrawalConfirmationQuestion.tsx:324
|
||||||
|
#, c-format
|
||||||
|
msgid "Withdrawal aborted!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/WithdrawalQRCode.tsx:54
|
#: src/pages/home/WithdrawalQRCode.tsx:54
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Abort"
|
msgid "Abort"
|
||||||
@ -339,31 +414,46 @@ msgstr ""
|
|||||||
msgid "History of public accounts"
|
msgid "History of public accounts"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/RegistrationPage.tsx:36
|
#: src/pages/home/RegistrationPage.tsx:39
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Currently, the bank is not accepting new registrations!"
|
msgid "Currently, the bank is not accepting new registrations!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/RegistrationPage.tsx:65
|
#: src/pages/home/RegistrationPage.tsx:68
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Use only letter and numbers starting with a lower case letter"
|
msgid "Use only letter and numbers starting with a lower case letter"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/RegistrationPage.tsx:75
|
#: src/pages/home/RegistrationPage.tsx:78
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Password don't match"
|
msgid "Password don't match"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/RegistrationPage.tsx:86
|
#: src/pages/home/RegistrationPage.tsx:89
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Please register!"
|
msgid "Please register!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/pages/home/RegistrationPage.tsx:123
|
#: src/pages/home/RegistrationPage.tsx:126
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Repeat Password:"
|
msgid "Repeat Password:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/RegistrationPage.tsx:226
|
||||||
|
#, c-format
|
||||||
|
msgid "Registration failed, please report"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/RegistrationPage.tsx:239
|
||||||
|
#, c-format
|
||||||
|
msgid "That username is already taken"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/pages/home/RegistrationPage.tsx:248
|
||||||
|
#, c-format
|
||||||
|
msgid "New registration gave response error"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: src/components/menu/SideBar.tsx:53
|
#: src/components/menu/SideBar.tsx:53
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bank menu"
|
msgid "Bank menu"
|
||||||
|
@ -20,7 +20,10 @@ import { h, VNode } from "preact";
|
|||||||
import { StateUpdater, useEffect, useRef, useState } from "preact/hooks";
|
import { StateUpdater, useEffect, useRef, useState } from "preact/hooks";
|
||||||
import { useBackendContext } from "../../context/backend.js";
|
import { useBackendContext } from "../../context/backend.js";
|
||||||
import { PageStateType, usePageContext } from "../../context/pageState.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 { BackendState } from "../../hooks/backend.js";
|
||||||
import { prepareHeaders, undefinedIfEmpty } from "../../utils.js";
|
import { prepareHeaders, undefinedIfEmpty } from "../../utils.js";
|
||||||
import { ShowInputErrorLabel } from "./ShowInputErrorLabel.js";
|
import { ShowInputErrorLabel } from "./ShowInputErrorLabel.js";
|
||||||
@ -192,6 +195,7 @@ export function PaytoWireTransferForm({
|
|||||||
iban: undefined,
|
iban: undefined,
|
||||||
subject: undefined,
|
subject: undefined,
|
||||||
})),
|
})),
|
||||||
|
i18n,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -291,6 +295,7 @@ export function PaytoWireTransferForm({
|
|||||||
backend.state,
|
backend.state,
|
||||||
pageStateSetter,
|
pageStateSetter,
|
||||||
() => rawPaytoInputSetter(undefined),
|
() => rawPaytoInputSetter(undefined),
|
||||||
|
i18n,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -357,6 +362,7 @@ async function createTransactionCall(
|
|||||||
* a stateful management of the input data yet.
|
* a stateful management of the input data yet.
|
||||||
*/
|
*/
|
||||||
cleanUpForm: () => void,
|
cleanUpForm: () => void,
|
||||||
|
i18n: InternationalizationAPI,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (backendState.status === "loggedOut") {
|
if (backendState.status === "loggedOut") {
|
||||||
logger.error("No credentials found.");
|
logger.error("No credentials found.");
|
||||||
@ -364,7 +370,7 @@ async function createTransactionCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: "No credentials found.",
|
title: i18n.str`No credentials found.`,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
@ -388,7 +394,7 @@ async function createTransactionCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `Could not create the wire transfer`,
|
title: i18n.str`Could not create the wire transfer`,
|
||||||
description: (error as any).error.description,
|
description: (error as any).error.description,
|
||||||
debug: JSON.stringify(error),
|
debug: JSON.stringify(error),
|
||||||
},
|
},
|
||||||
@ -405,7 +411,7 @@ async function createTransactionCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `Transfer creation gave response error`,
|
title: i18n.str`Transfer creation gave response error`,
|
||||||
description: response.error.description,
|
description: response.error.description,
|
||||||
debug: JSON.stringify(response),
|
debug: JSON.stringify(response),
|
||||||
},
|
},
|
||||||
@ -417,7 +423,7 @@ async function createTransactionCall(
|
|||||||
pageStateSetter((prevState) => ({
|
pageStateSetter((prevState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
info: "Wire transfer created!",
|
info: i18n.str`Wire transfer created!`,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Only at this point the input data can
|
// Only at this point the input data can
|
||||||
|
@ -44,9 +44,11 @@ export function QrCodeSection({
|
|||||||
<p>{i18n.str`Use this QR code to withdraw to your mobile wallet:`}</p>
|
<p>{i18n.str`Use this QR code to withdraw to your mobile wallet:`}</p>
|
||||||
{QR({ text: talerWithdrawUri })}
|
{QR({ text: talerWithdrawUri })}
|
||||||
<p>
|
<p>
|
||||||
|
<i18n.Translate>
|
||||||
Click{" "}
|
Click{" "}
|
||||||
<a id="linkqr" href={talerWithdrawUri}>{i18n.str`this link`}</a> to
|
<a id="linkqr" href={talerWithdrawUri}>{i18n.str`this link`}</a>{" "}
|
||||||
open your Taler wallet!
|
to open your Taler wallet!
|
||||||
|
</i18n.Translate>
|
||||||
</p>
|
</p>
|
||||||
<br />
|
<br />
|
||||||
{abortButton}
|
{abortButton}
|
||||||
|
@ -19,7 +19,10 @@ import { route } from "preact-router";
|
|||||||
import { StateUpdater, useState } from "preact/hooks";
|
import { StateUpdater, useState } from "preact/hooks";
|
||||||
import { useBackendContext } from "../../context/backend.js";
|
import { useBackendContext } from "../../context/backend.js";
|
||||||
import { PageStateType, usePageContext } from "../../context/pageState.js";
|
import { PageStateType, usePageContext } from "../../context/pageState.js";
|
||||||
import { useTranslationContext } from "../../context/translation.js";
|
import {
|
||||||
|
InternationalizationAPI,
|
||||||
|
useTranslationContext,
|
||||||
|
} from "../../context/translation.js";
|
||||||
import { BackendStateHandler } from "../../hooks/backend.js";
|
import { BackendStateHandler } from "../../hooks/backend.js";
|
||||||
import { bankUiSettings } from "../../settings.js";
|
import { bankUiSettings } from "../../settings.js";
|
||||||
import { getBankBackendBaseUrl, undefinedIfEmpty } from "../../utils.js";
|
import { getBankBackendBaseUrl, undefinedIfEmpty } from "../../utils.js";
|
||||||
@ -148,6 +151,7 @@ function RegistrationForm(): VNode {
|
|||||||
{ username, password },
|
{ username, password },
|
||||||
backend, // will store BE URL, if OK.
|
backend, // will store BE URL, if OK.
|
||||||
pageStateSetter,
|
pageStateSetter,
|
||||||
|
i18n,
|
||||||
);
|
);
|
||||||
|
|
||||||
setUsername(undefined);
|
setUsername(undefined);
|
||||||
@ -193,6 +197,7 @@ async function registrationCall(
|
|||||||
*/
|
*/
|
||||||
backend: BackendStateHandler,
|
backend: BackendStateHandler,
|
||||||
pageStateSetter: StateUpdater<PageStateType>,
|
pageStateSetter: StateUpdater<PageStateType>,
|
||||||
|
i18n: InternationalizationAPI,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const url = getBankBackendBaseUrl();
|
const url = getBankBackendBaseUrl();
|
||||||
|
|
||||||
@ -218,7 +223,7 @@ async function registrationCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `Registration failed, please report`,
|
title: i18n.str`Registration failed, please report`,
|
||||||
debug: JSON.stringify(error),
|
debug: JSON.stringify(error),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
@ -231,7 +236,7 @@ async function registrationCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `That username is already taken`,
|
title: i18n.str`That username is already taken`,
|
||||||
debug: JSON.stringify(response),
|
debug: JSON.stringify(response),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
@ -240,7 +245,7 @@ async function registrationCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `New registration gave response error`,
|
title: i18n.str`New registration gave response error`,
|
||||||
debug: JSON.stringify(response),
|
debug: JSON.stringify(response),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
@ -19,7 +19,10 @@ import { h, VNode } from "preact";
|
|||||||
import { StateUpdater, useEffect, useRef } from "preact/hooks";
|
import { StateUpdater, useEffect, useRef } from "preact/hooks";
|
||||||
import { useBackendContext } from "../../context/backend.js";
|
import { useBackendContext } from "../../context/backend.js";
|
||||||
import { PageStateType, usePageContext } from "../../context/pageState.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 { BackendState } from "../../hooks/backend.js";
|
||||||
import { prepareHeaders, validateAmount } from "../../utils.js";
|
import { prepareHeaders, validateAmount } from "../../utils.js";
|
||||||
|
|
||||||
@ -91,6 +94,7 @@ export function WalletWithdrawForm({
|
|||||||
`${currency}:${submitAmount}`,
|
`${currency}:${submitAmount}`,
|
||||||
backend.state,
|
backend.state,
|
||||||
pageStateSetter,
|
pageStateSetter,
|
||||||
|
i18n,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -113,6 +117,7 @@ async function createWithdrawalCall(
|
|||||||
amount: string,
|
amount: string,
|
||||||
backendState: BackendState,
|
backendState: BackendState,
|
||||||
pageStateSetter: StateUpdater<PageStateType>,
|
pageStateSetter: StateUpdater<PageStateType>,
|
||||||
|
i18n: InternationalizationAPI,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (backendState?.status === "loggedOut") {
|
if (backendState?.status === "loggedOut") {
|
||||||
logger.error("Page has a problem: no credentials found in the state.");
|
logger.error("Page has a problem: no credentials found in the state.");
|
||||||
@ -120,7 +125,7 @@ async function createWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: "No credentials given.",
|
title: i18n.str`No credentials given.`,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
@ -147,7 +152,7 @@ async function createWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `Could not create withdrawal operation`,
|
title: i18n.str`Could not create withdrawal operation`,
|
||||||
description: (error as any).error.description,
|
description: (error as any).error.description,
|
||||||
debug: JSON.stringify(error),
|
debug: JSON.stringify(error),
|
||||||
},
|
},
|
||||||
@ -163,7 +168,7 @@ async function createWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `Withdrawal creation gave response error`,
|
title: i18n.str`Withdrawal creation gave response error`,
|
||||||
description: response.error.description,
|
description: response.error.description,
|
||||||
debug: JSON.stringify(response),
|
debug: JSON.stringify(response),
|
||||||
},
|
},
|
||||||
|
@ -19,7 +19,10 @@ import { Fragment, h, VNode } from "preact";
|
|||||||
import { StateUpdater } from "preact/hooks";
|
import { StateUpdater } from "preact/hooks";
|
||||||
import { useBackendContext } from "../../context/backend.js";
|
import { useBackendContext } from "../../context/backend.js";
|
||||||
import { PageStateType, usePageContext } from "../../context/pageState.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 { BackendState } from "../../hooks/backend.js";
|
||||||
import { prepareHeaders } from "../../utils.js";
|
import { prepareHeaders } from "../../utils.js";
|
||||||
|
|
||||||
@ -80,6 +83,7 @@ export function WithdrawalConfirmationQuestion(): VNode {
|
|||||||
backend.state,
|
backend.state,
|
||||||
pageState.withdrawalId,
|
pageState.withdrawalId,
|
||||||
pageStateSetter,
|
pageStateSetter,
|
||||||
|
i18n,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -102,6 +106,7 @@ export function WithdrawalConfirmationQuestion(): VNode {
|
|||||||
backend.state,
|
backend.state,
|
||||||
pageState.withdrawalId,
|
pageState.withdrawalId,
|
||||||
pageStateSetter,
|
pageStateSetter,
|
||||||
|
i18n,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@ -139,6 +144,7 @@ async function confirmWithdrawalCall(
|
|||||||
backendState: BackendState,
|
backendState: BackendState,
|
||||||
withdrawalId: string | undefined,
|
withdrawalId: string | undefined,
|
||||||
pageStateSetter: StateUpdater<PageStateType>,
|
pageStateSetter: StateUpdater<PageStateType>,
|
||||||
|
i18n: InternationalizationAPI,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (backendState.status === "loggedOut") {
|
if (backendState.status === "loggedOut") {
|
||||||
logger.error("No credentials found.");
|
logger.error("No credentials found.");
|
||||||
@ -146,7 +152,7 @@ async function confirmWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: "No credentials found.",
|
title: i18n.str`"No credentials found.`,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
@ -157,7 +163,7 @@ async function confirmWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: "No withdrawal ID found.",
|
title: i18n.str`No withdrawal ID found.`,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
@ -192,7 +198,7 @@ async function confirmWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `Could not confirm the withdrawal`,
|
title: i18n.str`Could not confirm the withdrawal`,
|
||||||
description: (error as any).error.description,
|
description: (error as any).error.description,
|
||||||
debug: JSON.stringify(error),
|
debug: JSON.stringify(error),
|
||||||
},
|
},
|
||||||
@ -210,7 +216,7 @@ async function confirmWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `Withdrawal confirmation gave response error`,
|
title: i18n.str`Withdrawal confirmation gave response error`,
|
||||||
debug: JSON.stringify(response),
|
debug: JSON.stringify(response),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
@ -222,7 +228,7 @@ async function confirmWithdrawalCall(
|
|||||||
return {
|
return {
|
||||||
...rest,
|
...rest,
|
||||||
|
|
||||||
info: "Withdrawal confirmed!",
|
info: i18n.str`Withdrawal confirmed!`,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -234,6 +240,7 @@ async function abortWithdrawalCall(
|
|||||||
backendState: BackendState,
|
backendState: BackendState,
|
||||||
withdrawalId: string | undefined,
|
withdrawalId: string | undefined,
|
||||||
pageStateSetter: StateUpdater<PageStateType>,
|
pageStateSetter: StateUpdater<PageStateType>,
|
||||||
|
i18n: InternationalizationAPI,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (backendState.status === "loggedOut") {
|
if (backendState.status === "loggedOut") {
|
||||||
logger.error("No credentials found.");
|
logger.error("No credentials found.");
|
||||||
@ -241,7 +248,7 @@ async function abortWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `No credentials found.`,
|
title: i18n.str`No credentials found.`,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
@ -252,7 +259,7 @@ async function abortWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `No withdrawal ID found.`,
|
title: i18n.str`No withdrawal ID found.`,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
return;
|
return;
|
||||||
@ -284,7 +291,7 @@ async function abortWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `Could not abort the withdrawal.`,
|
title: i18n.str`Could not abort the withdrawal.`,
|
||||||
description: (error as any).error.description,
|
description: (error as any).error.description,
|
||||||
debug: JSON.stringify(error),
|
debug: JSON.stringify(error),
|
||||||
},
|
},
|
||||||
@ -301,7 +308,7 @@ async function abortWithdrawalCall(
|
|||||||
...prevState,
|
...prevState,
|
||||||
|
|
||||||
error: {
|
error: {
|
||||||
title: `Withdrawal abortion failed.`,
|
title: i18n.str`Withdrawal abortion failed.`,
|
||||||
description: response.error.description,
|
description: response.error.description,
|
||||||
debug: JSON.stringify(response),
|
debug: JSON.stringify(response),
|
||||||
},
|
},
|
||||||
@ -314,7 +321,7 @@ async function abortWithdrawalCall(
|
|||||||
return {
|
return {
|
||||||
...rest,
|
...rest,
|
||||||
|
|
||||||
info: "Withdrawal aborted!",
|
info: i18n.str`Withdrawal aborted!`,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user