summaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-01-14 16:00:31 -0300
committerSebastian <sebasjm@gmail.com>2024-01-14 16:01:45 -0300
commitb1c1da74b43abc3355a70dfc533ad5af8a5f47c9 (patch)
tree030ea07141fe0012856e7c58b54229e88d82ecff /packages/demobank-ui/src/pages
parentc004962331934886167df1168611c02bbb643927 (diff)
downloadwallet-core-b1c1da74b43abc3355a70dfc533ad5af8a5f47c9.tar.gz
wallet-core-b1c1da74b43abc3355a70dfc533ad5af8a5f47c9.tar.bz2
wallet-core-b1c1da74b43abc3355a70dfc533ad5af8a5f47c9.zip
fix some wording
Diffstat (limited to 'packages/demobank-ui/src/pages')
-rw-r--r--packages/demobank-ui/src/pages/AccountPage/views.tsx2
-rw-r--r--packages/demobank-ui/src/pages/LoginForm.tsx10
-rw-r--r--packages/demobank-ui/src/pages/OperationState/views.tsx3
-rw-r--r--packages/demobank-ui/src/pages/PaymentOptions.tsx9
-rw-r--r--packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx11
-rw-r--r--packages/demobank-ui/src/pages/ProfileNavigation.tsx2
-rw-r--r--packages/demobank-ui/src/pages/QrCodeSection.tsx2
-rw-r--r--packages/demobank-ui/src/pages/RegistrationPage.tsx2
-rw-r--r--packages/demobank-ui/src/pages/SolveChallengePage.tsx6
-rw-r--r--packages/demobank-ui/src/pages/WalletWithdrawForm.tsx4
-rw-r--r--packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx27
-rw-r--r--packages/demobank-ui/src/pages/WithdrawalQRCode.tsx9
-rw-r--r--packages/demobank-ui/src/pages/admin/AccountForm.tsx19
-rw-r--r--packages/demobank-ui/src/pages/admin/AccountList.tsx4
-rw-r--r--packages/demobank-ui/src/pages/admin/AdminHome.tsx22
-rw-r--r--packages/demobank-ui/src/pages/business/CreateCashout.tsx12
-rw-r--r--packages/demobank-ui/src/pages/business/ShowCashoutDetails.tsx8
17 files changed, 79 insertions, 73 deletions
diff --git a/packages/demobank-ui/src/pages/AccountPage/views.tsx b/packages/demobank-ui/src/pages/AccountPage/views.tsx
index 59a6db7b9..7e40b93eb 100644
--- a/packages/demobank-ui/src/pages/AccountPage/views.tsx
+++ b/packages/demobank-ui/src/pages/AccountPage/views.tsx
@@ -71,7 +71,7 @@ function ShowPedingOperation(): VNode {
})(bankState.currentChallenge.operation)
return <Attention title={title} type="warning" onClose={() => { updateBankState("currentChallenge", undefined); }}>
<i18n.Translate>
- To complete or cancel the operation click <a class="font-semibold text-yellow-700 hover:text-yellow-600" href={`#/2fa`}>here</a>
+ You can complete or cancel the operation in this <a class="font-semibold text-yellow-700 hover:text-yellow-600" href={`#/2fa`}><i18n.Translate>page</i18n.Translate></a>
</i18n.Translate>
</Attention>
}
diff --git a/packages/demobank-ui/src/pages/LoginForm.tsx b/packages/demobank-ui/src/pages/LoginForm.tsx
index 5eaad4bb0..627252682 100644
--- a/packages/demobank-ui/src/pages/LoginForm.tsx
+++ b/packages/demobank-ui/src/pages/LoginForm.tsx
@@ -37,8 +37,8 @@ export function LoginForm({ currentUser, fixedUser, onRegister }: { fixedUser?:
const { i18n } = useTranslationContext();
const { api } = useBankCoreApiContext();
const [notification, notify, handleError] = useLocalNotification()
- const {config} = useBankCoreApiContext();
-
+ const { config } = useBankCoreApiContext();
+
const ref = useRef<HTMLInputElement>(null);
useEffect(function focusInput() {
ref.current?.focus();
@@ -123,6 +123,7 @@ export function LoginForm({ currentUser, fixedUser, onRegister }: { fixedUser?:
enterkeyhint="next"
placeholder="identification"
autocomplete="username"
+ title={i18n.str`username of the account`}
required
onInput={(e): void => {
setUsername(e.currentTarget.value);
@@ -137,7 +138,9 @@ export function LoginForm({ currentUser, fixedUser, onRegister }: { fixedUser?:
<div>
<div class="flex items-center justify-between">
- <label for="password" class="block text-sm font-medium leading-6 text-gray-900">Password</label>
+ <label for="password" class="block text-sm font-medium leading-6 text-gray-900">
+ <i18n.Translate>Password</i18n.Translate>
+ </label>
</div>
<div class="mt-2">
<input
@@ -149,6 +152,7 @@ export function LoginForm({ currentUser, fixedUser, onRegister }: { fixedUser?:
enterkeyhint="send"
value={password ?? ""}
placeholder="Password"
+ title={i18n.str`password of the account`}
required
onInput={(e): void => {
setPassword(e.currentTarget.value);
diff --git a/packages/demobank-ui/src/pages/OperationState/views.tsx b/packages/demobank-ui/src/pages/OperationState/views.tsx
index d0016a2f3..05d53bb05 100644
--- a/packages/demobank-ui/src/pages/OperationState/views.tsx
+++ b/packages/demobank-ui/src/pages/OperationState/views.tsx
@@ -93,10 +93,9 @@ export function NeedConfirmationView({ error, onAbort: doAbort, onConfirm: doCon
description: resp.detail.hint as TranslatedString,
debug: resp.detail,
})
- // FIXME: remove exchange word
case TalerErrorCode.BANK_CONFIRM_INCOMPLETE: return notify({
type: "error",
- title: i18n.str`The withdraw operation cannot be confirmed because no exchange and reserve public key selection happened before`,
+ title: i18n.str`The withdrawal operation can't be confirmed before a wallet accepted the transaction.`,
description: resp.detail.hint as TranslatedString,
debug: resp.detail,
})
diff --git a/packages/demobank-ui/src/pages/PaymentOptions.tsx b/packages/demobank-ui/src/pages/PaymentOptions.tsx
index 06d293097..2a7374cab 100644
--- a/packages/demobank-ui/src/pages/PaymentOptions.tsx
+++ b/packages/demobank-ui/src/pages/PaymentOptions.tsx
@@ -41,7 +41,7 @@ export function PaymentOptions({ limit, goToConfirmOperation, onAuthorizationReq
<fieldset>
<legend class="px-4 text-base font-semibold leading-6 text-gray-900">
- <i18n.Translate>Send money to</i18n.Translate>
+ <i18n.Translate>Send money</i18n.Translate>
</legend>
<div class="px-4 mt-4 grid grid-cols-1 gap-y-6 sm:grid-cols-2 sm:gap-x-4">
@@ -49,12 +49,13 @@ export function PaymentOptions({ limit, goToConfirmOperation, onAuthorizationReq
<label class={"relative flex cursor-pointer rounded-lg border bg-white p-4 shadow-sm focus:outline-none" + (tab === "charge-wallet" ? "border-indigo-600 ring-2 ring-indigo-600" : "border-gray-300")}>
<input type="radio" name="project-type" value="Newsletter" class="sr-only" aria-labelledby="project-type-0-label" aria-describedby="project-type-0-description-0 project-type-0-description-1" onClick={() => {
setTab("charge-wallet")
- }} />
+ }}
+ />
<div class="flex flex-col">
<span class="flex">
<div class="text-4xl mr-4 my-auto">&#x1F4B5;</div>
<span class="grow self-center text-lg text-gray-900 align-middle text-center">
- <i18n.Translate>a <b>Taler</b> wallet</i18n.Translate>
+ <i18n.Translate>to a <b>Taler</b> wallet</i18n.Translate>
</span>
<svg class="self-center flex-none h-5 w-5 text-indigo-600" style={{ visibility: tab === "charge-wallet" ? "visible" : "hidden" }} viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" />
@@ -83,7 +84,7 @@ export function PaymentOptions({ limit, goToConfirmOperation, onAuthorizationReq
<span class="flex">
<div class="text-4xl mr-4 my-auto">&#x2194;</div>
<span class="grow self-center text-lg font-medium text-gray-900 align-middle text-center">
- <i18n.Translate>another bank account</i18n.Translate>
+ <i18n.Translate>to another bank account</i18n.Translate>
</span>
<svg class="self-center flex-none h-5 w-5 text-indigo-600" style={{ visibility: tab === "wire-transfer" ? "visible" : "hidden" }} viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" />
diff --git a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
index f7b81be48..d60b06dc3 100644
--- a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
+++ b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
@@ -330,7 +330,7 @@ export function PaytoWireTransferForm({
name="subject"
id="subject"
autocomplete="off"
- placeholder="subject"
+ placeholder={i18n.str`subject`}
value={subject ?? ""}
required
onInput={(e): void => {
@@ -342,7 +342,9 @@ export function PaytoWireTransferForm({
isDirty={subject !== undefined}
/>
</div>
- <p class="mt-2 text-sm text-gray-500" >some text to identify the transfer</p>
+ <p class="mt-2 text-sm text-gray-500" >
+ <i18n.Translate>some text to identify the transfer</i18n.Translate>
+ </p>
</div>
<div class="sm:col-span-5">
@@ -360,7 +362,9 @@ export function PaytoWireTransferForm({
message={errorsWire?.amount}
isDirty={trimmedAmountStr !== undefined}
/>
- <p class="mt-2 text-sm text-gray-500" >amount to transfer</p>
+ <p class="mt-2 text-sm text-gray-500" >
+ <i18n.Translate>amount to transfer</i18n.Translate>
+ </p>
</div>
</div> :
@@ -377,6 +381,7 @@ export function PaytoWireTransferForm({
class="block overflow-hidden w-44 sm:w-96 rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"
value={rawPaytoInput ?? ""}
required
+ title={i18n.str`uniform resource identifier of the target account`}
placeholder={i18n.str`payto://iban/[receiver-iban]?message=[subject]&amount=[${limit.currency}:X.Y]`}
onInput={(e): void => {
rawPaytoInputSetter(e.currentTarget.value);
diff --git a/packages/demobank-ui/src/pages/ProfileNavigation.tsx b/packages/demobank-ui/src/pages/ProfileNavigation.tsx
index 3596d0f11..bd9883b1b 100644
--- a/packages/demobank-ui/src/pages/ProfileNavigation.tsx
+++ b/packages/demobank-ui/src/pages/ProfileNavigation.tsx
@@ -62,7 +62,7 @@ export function ProfileNavigation({ current }: { current: "details" | "delete" |
</a>
{config.allow_conversion && nonAdminUser ?
<a href="#/my-cashouts" data-selected={current == "cashouts"} class="rounded-r-lg text-gray-500 hover:text-gray-700 data-[selected=true]:text-gray-900 group relative min-w-0 flex-1 overflow-hidden bg-white py-4 px-4 text-center text-sm font-medium hover:bg-gray-50 focus:z-10">
- <span>Cashouts</span>
+ <span><i18n.Translate>Cashouts</i18n.Translate></span>
<span aria-hidden="true" data-selected={current == "cashouts"} class="bg-transparent data-[selected=true]:bg-indigo-500 absolute inset-x-0 bottom-0 h-0.5"></span>
</a>
: undefined}
diff --git a/packages/demobank-ui/src/pages/QrCodeSection.tsx b/packages/demobank-ui/src/pages/QrCodeSection.tsx
index 64ebf7e83..606337cb1 100644
--- a/packages/demobank-ui/src/pages/QrCodeSection.tsx
+++ b/packages/demobank-ui/src/pages/QrCodeSection.tsx
@@ -104,7 +104,7 @@ export function QrCodeSection({
<div class="mt-4 mb-4 text-sm text-gray-500">
<p><i18n.Translate>
You will see the details of the operation in your wallet including the fees (if applies).
- If you still don't have one you can install it from <a class="font-semibold text-gray-500 hover:text-gray-400" href="https://taler.net/en/wallet.html">here</a>.
+ If you still don't have one you can install it following instructions in this <a class="font-semibold text-gray-500 hover:text-gray-400" href="https://taler.net/en/wallet.html"><i18n.Translate>page</i18n.Translate></a>.
</i18n.Translate></p>
</div>
<div class="flex items-center justify-between gap-x-6 border-t border-gray-900/10 pt-2 mt-2 ">
diff --git a/packages/demobank-ui/src/pages/RegistrationPage.tsx b/packages/demobank-ui/src/pages/RegistrationPage.tsx
index e7ed8a2b8..005a0bc2c 100644
--- a/packages/demobank-ui/src/pages/RegistrationPage.tsx
+++ b/packages/demobank-ui/src/pages/RegistrationPage.tsx
@@ -436,7 +436,7 @@ function RegistrationForm({ onComplete, onCancel }: { onComplete: () => void, on
doRandomRegistration()
}}
>
- <i18n.Translate>Create a random user</i18n.Translate>
+ <i18n.Translate>Create a random temporary user</i18n.Translate>
</button>
</p>
}
diff --git a/packages/demobank-ui/src/pages/SolveChallengePage.tsx b/packages/demobank-ui/src/pages/SolveChallengePage.tsx
index 426866e40..3647f2b65 100644
--- a/packages/demobank-ui/src/pages/SolveChallengePage.tsx
+++ b/packages/demobank-ui/src/pages/SolveChallengePage.tsx
@@ -297,7 +297,7 @@ export function SolveChallengePage({
}
function ChallengeDetails({ challenge, onStart }: { challenge: ChallengeInProgess, onStart: () => void }): VNode {
- const { i18n } = useTranslationContext();
+ const { i18n, dateLocale } = useTranslationContext();
const { config } = useBankCoreApiContext();
return <div class="px-4 mt-4 ">
@@ -445,9 +445,9 @@ function ChallengeDetails({ challenge, onStart }: { challenge: ChallengeInProges
}
{challenge.sent.t_ms !== "never" &&
<div class="px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
- <dt class="text-sm font-medium leading-6 text-gray-900">Sent at</dt>
+ <dt class="text-sm font-medium leading-6 text-gray-900"><i18n.Translate>Sent at</i18n.Translate></dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
- {format(challenge.sent.t_ms, "dd/MM/yyyy HH:mm:ss")}
+ {format(challenge.sent.t_ms, "dd/MM/yyyy HH:mm:ss", { locale: dateLocale })}
</dd>
</div>
}
diff --git a/packages/demobank-ui/src/pages/WalletWithdrawForm.tsx b/packages/demobank-ui/src/pages/WalletWithdrawForm.tsx
index c04e85e0c..70b83fa82 100644
--- a/packages/demobank-ui/src/pages/WalletWithdrawForm.tsx
+++ b/packages/demobank-ui/src/pages/WalletWithdrawForm.tsx
@@ -66,7 +66,7 @@ function OldWithdrawalForm({ goToConfirmOperation, limit, onCancel, focus }: {
return <Attention type="warning" title={i18n.str`There is an operation already`}>
<span ref={focus ? doAutoFocus : undefined} />
<i18n.Translate>
- To complete or cancel the operation click <a class="font-semibold text-yellow-700 hover:text-yellow-600" href={`#/operation/${bankState.currentWithdrawalOperationId}`}>here</a>
+ To complete or cancel the operation in this <a class="font-semibold text-yellow-700 hover:text-yellow-600" href={`#/operation/${bankState.currentWithdrawalOperationId}`}><i18n.Translate>page</i18n.Translate></a>
</i18n.Translate>
</Attention>
}
@@ -261,7 +261,7 @@ export function WalletWithdrawForm({
updateSettings("showInstallWallet", false);
}}>
<i18n.Translate>
- If you don't have one yet you can follow the instruction <a target="_blank" rel="noreferrer noopener" class="font-semibold text-blue-700 hover:text-blue-600" href="https://taler.net/en/wallet.html">here</a>
+ If you don't have one yet you can follow the instruction in this <a target="_blank" rel="noreferrer noopener" class="font-semibold text-blue-700 hover:text-blue-600" href="https://taler.net/en/wallet.html"><i18n.Translate>page</i18n.Translate></a>
</i18n.Translate>
</Attention>
}
diff --git a/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx b/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx
index a2ddc725e..3d1239857 100644
--- a/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx
+++ b/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx
@@ -93,10 +93,9 @@ export function WithdrawalConfirmationQuestion({
description: resp.detail.hint as TranslatedString,
debug: resp.detail,
});
- // FIXME: remove exchange word
case TalerErrorCode.BANK_CONFIRM_INCOMPLETE: return notify({
type: "error",
- title: i18n.str`The withdraw operation cannot be confirmed because no exchange and reserve public key selection happened before`,
+ title: i18n.str`The withdrawal operation can't be confirmed before a wallet accepted the transaction.`,
description: resp.detail.hint as TranslatedString,
debug: resp.detail,
});
@@ -200,12 +199,16 @@ export function WithdrawalConfirmationQuestion({
const name = p.params["receiver-name"]
return <Fragment>
<div class="px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
- <dt class="text-sm font-medium leading-6 text-gray-900">Exchange account</dt>
+ <dt class="text-sm font-medium leading-6 text-gray-900">
+ <i18n.Translate>Taler Exchange operator's account</i18n.Translate>
+ </dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">{p.iban}</dd>
</div>
{name &&
<div class="px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
- <dt class="text-sm font-medium leading-6 text-gray-900">Exchange name</dt>
+ <dt class="text-sm font-medium leading-6 text-gray-900">
+ <i18n.Translate>Taler Exchange operator's name</i18n.Translate>
+ </dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">{p.params["receiver-name"]}</dd>
</div>
}
@@ -216,12 +219,16 @@ export function WithdrawalConfirmationQuestion({
const name = p.params["receiver-name"]
return <Fragment>
<div class="px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
- <dt class="text-sm font-medium leading-6 text-gray-900">Exchange account</dt>
+ <dt class="text-sm font-medium leading-6 text-gray-900">
+ <i18n.Translate>Taler Exchange operator's account</i18n.Translate>
+ </dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">{p.account}</dd>
</div>
{name &&
<div class="px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
- <dt class="text-sm font-medium leading-6 text-gray-900">Exchange name</dt>
+ <dt class="text-sm font-medium leading-6 text-gray-900">
+ <i18n.Translate>Taler Exchange operator's name</i18n.Translate>
+ </dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">{p.params["receiver-name"]}</dd>
</div>
}
@@ -229,14 +236,18 @@ export function WithdrawalConfirmationQuestion({
}
default:
return <div class="px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
- <dt class="text-sm font-medium leading-6 text-gray-900">Exchange account</dt>
+ <dt class="text-sm font-medium leading-6 text-gray-900">
+ <i18n.Translate>Taler Exchange operator's account</i18n.Translate>
+ </dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">{details.account.targetPath}</dd>
</div>
}
})()}
<div class="px-4 py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
- <dt class="text-sm font-medium leading-6 text-gray-900">Amount</dt>
+ <dt class="text-sm font-medium leading-6 text-gray-900">
+ <i18n.Translate>Amount</i18n.Translate>
+ </dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0">
<RenderAmount value={details.amount} spec={config.currency_specification} />
</dd>
diff --git a/packages/demobank-ui/src/pages/WithdrawalQRCode.tsx b/packages/demobank-ui/src/pages/WithdrawalQRCode.tsx
index c81c4ab8a..c9384e945 100644
--- a/packages/demobank-ui/src/pages/WithdrawalQRCode.tsx
+++ b/packages/demobank-ui/src/pages/WithdrawalQRCode.tsx
@@ -73,9 +73,8 @@ export function WithdrawalQRCode({
<h1 class="nav">{i18n.str`Operation aborted`}</h1>
<section>
<p>
-
<i18n.Translate>
- The wire transfer to the GNU Taler Exchange bank's account was aborted, your balance
+ The wire transfer to the Taler Exchange operator's account was aborted, your balance
was not affected.
</i18n.Translate>
</p>
@@ -147,7 +146,7 @@ export function WithdrawalQRCode({
if (!data.selected_reserve_pub) {
return <Attention type="danger"
title={i18n.str`The operation is incomplete or some step in the withdrawal failed`} >
- <i18n.Translate>The exchange is selected but no reserve public key found.</i18n.Translate>
+ <i18n.Translate>The wallet confirmation is partially confirmed. The Taler Exchange operator is selected but no withdrawal identification found.</i18n.Translate>
</Attention>
}
@@ -155,8 +154,8 @@ export function WithdrawalQRCode({
if (!account) {
return <Attention type="danger"
- title={i18n.str`The operation is incomplete or some step in the withdrawal failed`} >
- <i18n.Translate>The exchange is selected but the exchange payto URI is missing or invalid.</i18n.Translate>
+ title={i18n.str`The operation is incomplete or some step in the withdrawal failed`}>
+ <i18n.Translate>The Taler Exchange operator is selected but the Taler Exchange operator account is missing or invalid.</i18n.Translate>
</Attention>
}
diff --git a/packages/demobank-ui/src/pages/admin/AccountForm.tsx b/packages/demobank-ui/src/pages/admin/AccountForm.tsx
index 827b2a0f0..e08fee8bc 100644
--- a/packages/demobank-ui/src/pages/admin/AccountForm.tsx
+++ b/packages/demobank-ui/src/pages/admin/AccountForm.tsx
@@ -110,7 +110,7 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({
? undefined :
!editableCashout ? undefined :
!cashoutParsed
- ? i18n.str`does not follow the pattern` :
+ ? i18n.str`it doesnt have the pattern of an IBAN number` :
!cashoutParsed.isKnown || cashoutParsed.targetType !== "iban"
? i18n.str`only "IBAN" target are supported` :
!IBAN_REGEX.test(cashoutParsed.iban)
@@ -120,7 +120,7 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({
? undefined :
!editableAccount ? undefined :
!internalParsed
- ? i18n.str`does not follow the pattern` :
+ ? i18n.str`it doesnt have the pattern of an IBAN number` :
!internalParsed.isKnown || internalParsed.targetType !== "iban"
? i18n.str`only "IBAN" target are supported` :
!IBAN_REGEX.test(internalParsed.iban)
@@ -129,7 +129,7 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({
email: !newForm.email
? undefined :
!EMAIL_REGEX.test(newForm.email)
- ? i18n.str`it should be an email` :
+ ? i18n.str`it doesnt have the pattern of an email` :
undefined,
phone: !newForm.phone
? undefined :
@@ -400,7 +400,9 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({
message={errors?.debit_threshold ? String(errors?.debit_threshold) : undefined}
isDirty={form.debit_threshold !== undefined}
/>
- <p class="mt-2 text-sm text-gray-500" >how much is user able to transfer </p>
+ <p class="mt-2 text-sm text-gray-500" >
+ <i18n.Translate>how much is user able to transfer after zero balance</i18n.Translate>
+ </p>
</div>
{purpose !== "create" || !userIsAdmin ? undefined :
@@ -437,7 +439,7 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({
class="block text-sm font-medium leading-6 text-gray-900"
for="channel"
>
- {i18n.str`Confirm the operation using`}
+ {i18n.str`Enable second factor authentication`}
</label>
<div class="mt-2 max-w-xl text-sm text-gray-500">
<div class="px-4 mt-4 grid grid-cols-1 gap-y-6">
@@ -457,7 +459,7 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({
<span class="flex flex-1">
<span class="flex flex-col">
<span id="project-type-0-label" class="block text-sm font-medium text-gray-900 ">
- <i18n.Translate>Email</i18n.Translate>
+ <i18n.Translate>Using email</i18n.Translate>
</span>
{purpose !== "show" && !hasEmail && i18n.str`add a email in your profile to enable this option`}
</span>
@@ -484,7 +486,7 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({
<span class="flex flex-1">
<span class="flex flex-col">
<span id="project-type-1-label" class="block text-sm font-medium text-gray-900">
- <i18n.Translate>SMS</i18n.Translate>
+ <i18n.Translate>Using SMS</i18n.Translate>
</span>
{purpose !== "show" && !hasPhone && i18n.str`add a phone number in your profile to enable this option`}
</span>
@@ -494,9 +496,6 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({
</svg>
</label>
}
- <pre>
- {JSON.stringify(form, undefined, 2)}
- </pre>
</div>
</div>
</div>
diff --git a/packages/demobank-ui/src/pages/admin/AccountList.tsx b/packages/demobank-ui/src/pages/admin/AccountList.tsx
index dd4586697..4ec25660b 100644
--- a/packages/demobank-ui/src/pages/admin/AccountList.tsx
+++ b/packages/demobank-ui/src/pages/admin/AccountList.tsx
@@ -115,7 +115,7 @@ export function AccountList({ onRemoveAccount, onShowAccountDetails, onUpdateAcc
onUpdateAccountPassword(item.username)
}}
>
- change password
+ <i18n.Translate>change password</i18n.Translate>
</a>
<br />
{noBalance ?
@@ -124,7 +124,7 @@ export function AccountList({ onRemoveAccount, onShowAccountDetails, onUpdateAcc
onRemoveAccount(item.username)
}}
>
- remove
+ <i18n.Translate>remove</i18n.Translate>
</a>
: undefined}
</td>
diff --git a/packages/demobank-ui/src/pages/admin/AdminHome.tsx b/packages/demobank-ui/src/pages/admin/AdminHome.tsx
index f5bce1396..3b06a7740 100644
--- a/packages/demobank-ui/src/pages/admin/AdminHome.tsx
+++ b/packages/demobank-ui/src/pages/admin/AdminHome.tsx
@@ -1,5 +1,5 @@
import { AmountString, Amounts, CurrencySpecification, TalerCorebankApi, TalerError, assertUnreachable } from "@gnu-taler/taler-util";
-import { useTranslationContext } from "@gnu-taler/web-util/browser";
+import { useLang, useTranslationContext } from "@gnu-taler/web-util/browser";
import { format, getDate, getHours, getMonth, getYear, setDate, setHours, setMonth, setYear, sub } from "date-fns";
import { Fragment, VNode, h } from "preact";
import { useState } from "preact/hooks";
@@ -11,7 +11,6 @@ import { RenderAmount } from "../PaytoWireTransferForm.js";
import { WireTransfer } from "../WireTransfer.js";
import { AccountList } from "./AccountList.js";
-
/**
* Query account information and show QR code if there is pending withdrawal
*/
@@ -40,15 +39,14 @@ export function AdminHome({ onCreateAccount, onAuthorizationRequired, onRemoveAc
</Fragment>
}
-function getDateForTimeframe(which: number, timeframe: TalerCorebankApi.MonitorTimeframeParam): string {
+function getDateForTimeframe(which: number, timeframe: TalerCorebankApi.MonitorTimeframeParam, locale: Locale): string {
const time = Date.now()
-
switch (timeframe) {
- case TalerCorebankApi.MonitorTimeframeParam.hour: return `${format(setHours(time, which), "HH")}hs`;
- case TalerCorebankApi.MonitorTimeframeParam.day: return format(setDate(time, which), "EEEE");
- case TalerCorebankApi.MonitorTimeframeParam.month: return format(setMonth(time, which), "MMMM");
- case TalerCorebankApi.MonitorTimeframeParam.year: return format(setYear(time, which), "yyyy");
- case TalerCorebankApi.MonitorTimeframeParam.decade: return format(setYear(time, which), "yyyy");
+ case TalerCorebankApi.MonitorTimeframeParam.hour: return `${format(setHours(time, which), "HH", { locale })}hs`;
+ case TalerCorebankApi.MonitorTimeframeParam.day: return format(setDate(time, which), "EEEE", { locale });
+ case TalerCorebankApi.MonitorTimeframeParam.month: return format(setMonth(time, which), "MMMM", { locale });
+ case TalerCorebankApi.MonitorTimeframeParam.year: return format(setYear(time, which), "yyyy", { locale });
+ case TalerCorebankApi.MonitorTimeframeParam.decade: return format(setYear(time, which), "yyyy", { locale });
}
assertUnreachable(timeframe)
}
@@ -81,7 +79,7 @@ export function getTimeframesForDate(time: Date, timeframe: TalerCorebankApi.Mon
function Metrics(): VNode {
- const { i18n } = useTranslationContext()
+ const { i18n, dateLocale } = useTranslationContext()
const [metricType, setMetricType] = useState<TalerCorebankApi.MonitorTimeframeParam>(TalerCorebankApi.MonitorTimeframeParam.hour);
const { config } = useBankCoreApiContext();
const respInfo = useConversionInfo()
@@ -132,7 +130,7 @@ function Metrics(): VNode {
<div class="w-full flex justify-between">
<h1 class="text-base font-semibold leading-7 text-gray-900 mt-5">
- <i18n.Translate>Trading volume on {getDateForTimeframe(params.current, metricType)} compared to {getDateForTimeframe(params.previous, metricType)}</i18n.Translate>
+ <i18n.Translate>Trading volume on {getDateForTimeframe(params.current, metricType, dateLocale)} compared to {getDateForTimeframe(params.previous, metricType, dateLocale)}</i18n.Translate>
</h1>
</div>
<dl class="mt-5 grid grid-cols-1 md:grid-cols-2 divide-y divide-gray-200 overflow-hidden rounded-lg bg-white shadow-lg md:divide-x md:divide-y-0">
@@ -186,7 +184,7 @@ function Metrics(): VNode {
<a href="#/download-stats"
class="disabled:opacity-50 disabled:cursor-default cursor-pointer rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
><i18n.Translate>
- download stats as csv
+ download stats as CSV
</i18n.Translate></a>
</div>
</Fragment>
diff --git a/packages/demobank-ui/src/pages/business/CreateCashout.tsx b/packages/demobank-ui/src/pages/business/CreateCashout.tsx
index e3602bff1..14e151ae6 100644
--- a/packages/demobank-ui/src/pages/business/CreateCashout.tsx
+++ b/packages/demobank-ui/src/pages/business/CreateCashout.tsx
@@ -417,11 +417,6 @@ export function CreateCashout({
<div class="flex items-center justify-between border-t-2 afu pt-4">
<dt class="flex items-center text-sm text-gray-600">
<span><i18n.Translate>Balance left</i18n.Translate></span>
- {/* <a href="#" class="ml-2 shrink-0 text-gray-400 bkx">
- <span class="sr-only">Learn more about how shipping is calculated</span>
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"
- class="w-5 h-5"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zM8.94 6.94a.75.75 0 11-1.061-1.061 3 3 0 112.871 5.026v.345a.75.75 0 01-1.5 0v-.5c0-.72.57-1.172 1.081-1.287A1.5 1.5 0 108.94 6.94zM10 15a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>
- </a> */}
</dt>
<dd class="text-sm text-gray-900">
<RenderAmount value={balanceAfter} spec={regional_currency_specification} />
@@ -431,11 +426,6 @@ export function CreateCashout({
<div class="flex items-center justify-between border-t-2 afu pt-4">
<dt class="flex items-center text-sm text-gray-600">
<span><i18n.Translate>Before fee</i18n.Translate></span>
- {/* <a href="#" class="ml-2 shrink-0 text-gray-400 bkx">
- <span class="sr-only">Learn more about how shipping is calculated</span>
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"
- class="w-5 h-5"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zM8.94 6.94a.75.75 0 11-1.061-1.061 3 3 0 112.871 5.026v.345a.75.75 0 01-1.5 0v-.5c0-.72.57-1.172 1.081-1.287A1.5 1.5 0 108.94 6.94zM10 15a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>
- </a> */}
</dt>
<dd class="text-sm text-gray-900">
<RenderAmount value={calc.beforeFee} spec={fiat_currency_specification} />
@@ -467,7 +457,7 @@ export function CreateCashout({
class="block text-sm font-medium leading-6 text-gray-900"
for="channel"
>
- {i18n.str`Confirm the operation using`}
+ {i18n.str`Second fac`}
</label>
<div class="mt-2 max-w-xl text-sm text-gray-500">
<div class="px-4 mt-4 grid grid-cols-1 gap-y-6">
diff --git a/packages/demobank-ui/src/pages/business/ShowCashoutDetails.tsx b/packages/demobank-ui/src/pages/business/ShowCashoutDetails.tsx
index 76876df5d..a55bf3ab6 100644
--- a/packages/demobank-ui/src/pages/business/ShowCashoutDetails.tsx
+++ b/packages/demobank-ui/src/pages/business/ShowCashoutDetails.tsx
@@ -52,7 +52,7 @@ export function ShowCashoutDetails({
id,
onCancel,
}: Props): VNode {
- const { i18n } = useTranslationContext();
+ const { i18n, dateLocale } = useTranslationContext();
const { state } = useBackendState();
const creds = state.status !== "loggedIn" ? undefined : state
const { api } = useBankCoreApiContext()
@@ -230,7 +230,7 @@ export function ShowCashoutDetails({
<div class="justify-between items-center flex ">
<dt class=" text-gray-600"><i18n.Translate>Created</i18n.Translate></dt>
<dd class="text-sm ">
- {format(result.body.creation_time.t_s * 1000, "dd/MM/yyyy HH:mm:ss")}
+ {format(result.body.creation_time.t_s * 1000, "dd/MM/yyyy HH:mm:ss", { locale: dateLocale })}
</dd>
</div>
: undefined}
@@ -256,7 +256,7 @@ export function ShowCashoutDetails({
<div class="flex justify-between items-center border-t-2 afu pt-4">
<dt class=" font-medium"><i18n.Translate>Confirmed</i18n.Translate></dt>
<dd class=" font-medium">
- {format(result.body.confirmation_time.t_s * 1000, "dd/MM/yyyy HH:mm:ss")}
+ {format(result.body.confirmation_time.t_s * 1000, "dd/MM/yyyy HH:mm:ss", { locale: dateLocale })}
</dd>
</div>
: undefined}
@@ -280,7 +280,7 @@ export function ShowCashoutDetails({
>
<div class="px-4 py-6 sm:p-8">
<label for="withdraw-amount">
- Enter the confirmation code
+ <i18n.Translate>Enter the confirmation code</i18n.Translate>
</label>
<div class="mt-2">
<div class="relative rounded-md shadow-sm">