taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 222af7f21b0d34d64ef514cfc5a038767b34303c
parent 7d801a7bb4f35ccd75dea2794b90dc0420469144
Author: Sebastian <sebasjm@gmail.com>
Date:   Thu,  7 Nov 2024 14:28:29 -0300

key changes from stefan

Diffstat:
Mpackages/bank-ui/src/components/Cashouts/views.tsx | 8++++----
Mpackages/bank-ui/src/components/Transactions/views.tsx | 2+-
Mpackages/bank-ui/src/pages/OperationState/views.tsx | 34++++++++++++++++++----------------
Mpackages/bank-ui/src/pages/PaytoWireTransferForm.tsx | 35++++++++++++++++-------------------
Mpackages/bank-ui/src/pages/QrCodeSection.tsx | 6+++---
Mpackages/bank-ui/src/pages/RegistrationPage.tsx | 16++++++++--------
Mpackages/bank-ui/src/pages/SolveChallengePage.tsx | 19++++++++++---------
Mpackages/bank-ui/src/pages/WalletWithdrawForm.tsx | 102++++++++++++++++++++++++++++++-------------------------------------------------
Mpackages/bank-ui/src/pages/WireTransfer.tsx | 2+-
Mpackages/bank-ui/src/pages/WithdrawalConfirmationQuestion.tsx | 30++++++++++++++++--------------
Mpackages/bank-ui/src/pages/WithdrawalQRCode.tsx | 43++++++++++++++++++++++---------------------
Mpackages/bank-ui/src/pages/account/ShowAccountDetails.tsx | 4++--
Mpackages/bank-ui/src/pages/admin/AccountForm.tsx | 10+++++-----
Mpackages/bank-ui/src/pages/admin/AdminHome.tsx | 59+++++++++++++++++++++++++++++++++++++++--------------------
Mpackages/bank-ui/src/pages/admin/CreateNewAccount.tsx | 6+++---
Mpackages/bank-ui/src/pages/regional/CreateCashout.tsx | 21+++++++++++----------
Mpackages/bank-ui/src/pages/regional/ShowCashoutDetails.tsx | 12++++++------
Mpackages/bank-ui/src/utils.ts | 3+--
18 files changed, 205 insertions(+), 207 deletions(-)

diff --git a/packages/bank-ui/src/components/Cashouts/views.tsx b/packages/bank-ui/src/components/Cashouts/views.tsx @@ -39,7 +39,7 @@ export function FailedView({ error }: State.Failed) { switch (error.case) { case HttpStatusCode.NotImplemented: { return ( - <Attention type="danger" title={i18n.str`Cashout are disabled`}> + <Attention type="danger" title={i18n.str`Cashout is disabled`}> <i18n.Translate> Cashout should be enable by configuration and the conversion rate should be initialized with fee, ratio and rounding mode. @@ -68,10 +68,10 @@ export function ReadyView({ switch (resp.case) { case HttpStatusCode.NotImplemented: { return ( - <Attention type="danger" title={i18n.str`Cashout are disabled`}> + <Attention type="danger" title={i18n.str`Cashout is disabled`}> <i18n.Translate> - Cashout should be enable by configuration and the conversion rate - should be initialized with fee, ratio and rounding mode. + Cashout should be enabled in the configuration, the conversion + rate should be initialized with fee(s), rates and a rounding mode. </i18n.Translate> </Attention> ); diff --git a/packages/bank-ui/src/components/Transactions/views.tsx b/packages/bank-ui/src/components/Transactions/views.tsx @@ -47,7 +47,7 @@ export function ReadyView({ <Attention type="low" title={i18n.str`No transactions yet.`}> <i18n.Translate> - You can start sending a wire transfer or withdrawing to your wallet. + You can make a transfer or a withdrawal to your wallet. </i18n.Translate> </Attention> </div> diff --git a/packages/bank-ui/src/pages/OperationState/views.tsx b/packages/bank-ui/src/pages/OperationState/views.tsx @@ -88,7 +88,7 @@ export function NeedConfirmationView({ case HttpStatusCode.BadRequest: return notify({ type: "error", - title: i18n.str`The operation id is invalid.`, + title: i18n.str`The operation ID is invalid.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -142,7 +142,7 @@ export function NeedConfirmationView({ case HttpStatusCode.BadRequest: return notify({ type: "error", - title: i18n.str`The operation id is invalid.`, + title: i18n.str`The operation ID is invalid.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -158,7 +158,7 @@ export function NeedConfirmationView({ case TalerErrorCode.BANK_UNALLOWED_DEBIT: return notify({ type: "error", - title: i18n.str`Your balance is not enough.`, + title: i18n.str`Your balance is not sufficient for the operation.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -223,7 +223,7 @@ export function NeedConfirmationView({ <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"> <i18n.Translate> - Payment provider's account + Payment Service Provider's account </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -240,7 +240,7 @@ export function NeedConfirmationView({ <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"> <i18n.Translate> - Payment provider's account number + Payment Service Provider's account number </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -251,7 +251,7 @@ export function NeedConfirmationView({ <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"> <i18n.Translate> - Payment provider's name + Payment Service Provider's name </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -269,7 +269,8 @@ export function NeedConfirmationView({ <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"> <i18n.Translate> - Payment provider's account bank hostname + Payment Service Provider's account bank + hostname </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -279,7 +280,7 @@ export function NeedConfirmationView({ <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"> <i18n.Translate> - Payment provider's account id + Payment Service Provider's account id </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -290,7 +291,7 @@ export function NeedConfirmationView({ <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"> <i18n.Translate> - Payment provider's name + Payment Service Provider's name </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -308,7 +309,7 @@ export function NeedConfirmationView({ <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"> <i18n.Translate> - Payment provider's account address + Payment Service Provider's account address </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -319,7 +320,7 @@ export function NeedConfirmationView({ <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"> <i18n.Translate> - Payment provider's name + Payment Service Provider's name </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -347,7 +348,7 @@ export function NeedConfirmationView({ /> ) : ( <i18n.Translate> - No amount specified yet. + No amount has yet been determined. </i18n.Translate> )} </dd> @@ -480,8 +481,9 @@ export function ConfirmedView({ routeClose }: State.Confirmed) { <div class="mt-2"> <p class="text-sm text-gray-500"> <i18n.Translate> - The wire transfer to the Taler operator has been initiated. You - will soon receive the requested amount in your Taler wallet. + The wire transfer to the Payment Service Provider has been + initiated. You will shortly receive the requested amount in your + Taler wallet.{" "} </i18n.Translate> </p> </div> @@ -565,7 +567,7 @@ export function ReadyView({ case HttpStatusCode.BadRequest: return notify({ type: "error", - title: i18n.str`The operation id is invalid.`, + title: i18n.str`The operation ID is invalid.`, description: hasError.detail?.hint as TranslatedString, debug: hasError.detail, when: AbsoluteTime.now(), @@ -638,7 +640,7 @@ export function ReadyView({ <div class="px-4 py-5 sm:p-6"> <h3 class="text-base font-semibold leading-6 text-gray-900"> <i18n.Translate> - Or if you have the Taler wallet on another device + In case you have a Taler wallet on another device </i18n.Translate> </h3> <div class="mt-4 max-w-xl text-sm text-gray-500"> diff --git a/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx @@ -222,7 +222,7 @@ export function PaytoWireTransferForm({ case TalerErrorCode.BANK_ADMIN_CREDITOR: return notify({ type: "error", - title: i18n.str`Bank administrator can't be the transfer creditor.`, + title: i18n.str`The bank administrator cannot be the transfer creditor.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -248,7 +248,7 @@ export function PaytoWireTransferForm({ case TalerErrorCode.BANK_UNALLOWED_DEBIT: return notify({ type: "error", - title: i18n.str`Your balance is not enough.`, + title: i18n.str`Your balance is not sufficient for the operation.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -264,7 +264,7 @@ export function PaytoWireTransferForm({ case TalerErrorCode.BANK_TRANSFER_REQUEST_UID_REUSED: { return notify({ type: "error", - title: i18n.str`Tried to create the transaction but failed, please try again.`, + title: i18n.str`The attempt to create the transaction has failed. Please try again.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -288,7 +288,7 @@ export function PaytoWireTransferForm({ assertUnreachable(resp); } } - notifyInfo(i18n.str`Wire transfer created!`); + notifyInfo(i18n.str`The wire transfer was successfully completed!`); onSuccess(); setAmount(undefined); setAccount(undefined); @@ -424,8 +424,8 @@ export function PaytoWireTransferForm({ class="block text-sm text-gray-500 data-[checked=true]:text-indigo-600" > <i18n.Translate> - A special URI that indicate the transfer amount and - account target. + A special URI that specifies the amount to be + transferred and the destination account. </i18n.Translate> </span> </span> @@ -459,7 +459,7 @@ export function PaytoWireTransferForm({ class="block text-sm text-gray-500 data-[checked=true]:text-indigo-600" > <i18n.Translate> - If you have a camera in this device you can import a + If your device has a camera, you can import a payto:// URI from a QR code. </i18n.Translate> </span> @@ -501,7 +501,7 @@ export function PaytoWireTransferForm({ id="x-taler-bank" required label={i18n.str`Recipient`} - help={i18n.str`Id of the recipient's account`} + help={i18n.str`ID of the recipient's account`} error={errorsWire?.account} onChange={setAccount} value={account} @@ -636,7 +636,7 @@ export function PaytoWireTransferForm({ {Amounts.cmp(limitWithFee, balance) > 0 ? ( <p class="mt-2 text-sm text-gray-900"> <i18n.Translate> - You can transfer{" "} + The maximum amount for a wire transfer is{" "} <RenderAmount value={limitWithFee} spec={config.currency_specification} @@ -838,7 +838,7 @@ function validateRawPayto( } if (!parsed.account) { - return i18n.str`Missing account name`; + return i18n.str`Account name is missing`; } const result = validateTalerBank(parsed.account, i18n); if (result) return result; @@ -865,13 +865,10 @@ function validateRawPayto( result = validateAmount(amount, limit, i18n); if (result) return result; - if (!parsed.params.message && !parsed.params.subject) { - return i18n.str`Missing the "message" or "subject" parameter to specify a reference text for the transfer`; + if (!parsed.params.message) { + return i18n.str`"message" parameters to specify a reference text for the transfer are missing`; } - const subject = !parsed.params.message - ? parsed.params.subject - : parsed.params.message; - result = validateSubject(subject, i18n); + result = validateSubject(parsed.params.message, i18n); if (result) return result; return undefined; @@ -886,10 +883,10 @@ function validateAmount( return i18n.str`The only currency allowed is "${limit.currency}"`; } if (Amounts.isZero(amount)) { - return i18n.str`Can't transfer zero amount`; + return i18n.str`You cannot transfer an amount of zero.`; } if (Amounts.cmp(limit, amount) === -1) { - return i18n.str`Balance is not enough`; + return i18n.str`The balance is not sufficient`; } return undefined; } @@ -899,7 +896,7 @@ function validateSubject( i18n: InternationalizationAPI, ): TranslatedString | undefined { if (text.length < 2) { - return i18n.str`Use a longer subject`; + return i18n.str`Please enter a longer subject`; } return undefined; } diff --git a/packages/bank-ui/src/pages/QrCodeSection.tsx b/packages/bank-ui/src/pages/QrCodeSection.tsx @@ -64,7 +64,7 @@ export function QrCodeSection({ (fail) => { switch (fail.case) { case HttpStatusCode.BadRequest: - return i18n.str`The operation id is invalid.`; + return i18n.str`The operation ID is invalid.`; case HttpStatusCode.NotFound: return i18n.str`The operation was not found.`; case HttpStatusCode.Conflict: @@ -125,12 +125,12 @@ export function QrCodeSection({ <div class="px-4 py-5 sm:p-6"> <h3 class="text-base font-semibold leading-6 text-gray-900"> <i18n.Translate> - Or if you have the Taler wallet on another device + In case you have a Taler wallet on another device </i18n.Translate> </h3> <div class="mt-4 max-w-xl text-sm text-gray-500"> <i18n.Translate> - Scan the QR below to start the withdrawal. + Scan the QR code below to start the withdrawal. </i18n.Translate> </div> <div class="mt-2 max-w-md ml-auto mr-auto"> diff --git a/packages/bank-ui/src/pages/RegistrationPage.tsx b/packages/bank-ui/src/pages/RegistrationPage.tsx @@ -81,7 +81,7 @@ function RegistrationForm({ const { i18n } = useTranslationContext(); const errors = undefinedIfEmpty({ - name: !name ? i18n.str`Missing name` : undefined, + name: !name ? i18n.str`The name is missing` : undefined, username: !username ? i18n.str`Missing username` : !USERNAME_REGEX.test(username) @@ -100,12 +100,12 @@ function RegistrationForm({ password: !password ? i18n.str`Missing password` : password.length < 8 - ? i18n.str`Password length should be greater than 8` + ? i18n.str`The password should be longer than 8 letters` : undefined, repeatPassword: !repeatPassword ? i18n.str`Missing password` : repeatPassword !== password - ? i18n.str`Passwords don't match` + ? i18n.str`The passwords do not match` : undefined, }); @@ -129,7 +129,7 @@ function RegistrationForm({ case HttpStatusCode.BadRequest: return i18n.str`Server replied with invalid phone or email.`; case HttpStatusCode.Unauthorized: - return i18n.str`No enough permission to create that account.`; + return i18n.str`You are not authorised to create this account.`; case TalerErrorCode.BANK_UNALLOWED_DEBIT: return i18n.str`Registration is disabled because the bank ran out of bonus credit.`; case TalerErrorCode.BANK_RESERVED_USERNAME_CONFLICT: @@ -137,21 +137,21 @@ function RegistrationForm({ case TalerErrorCode.BANK_REGISTER_USERNAME_REUSE: return i18n.str`That username is already taken.`; case TalerErrorCode.BANK_REGISTER_PAYTO_URI_REUSE: - return i18n.str`That account id is already taken.`; + return i18n.str`That account ID is already taken.`; case TalerErrorCode.BANK_MISSING_TAN_INFO: return i18n.str`No information for the selected authentication channel.`; case TalerErrorCode.BANK_TAN_CHANNEL_NOT_SUPPORTED: return i18n.str`Authentication channel is not supported.`; case TalerErrorCode.BANK_NON_ADMIN_PATCH_DEBT_LIMIT: - return i18n.str`Only admin is allow to set debt limit.`; + return i18n.str`Only an administrator is allowed to set the debt limit.`; case TalerErrorCode.BANK_NON_ADMIN_SET_MIN_CASHOUT: return i18n.str`Only the administrator can change the minimum cashout limit.`; case TalerErrorCode.BANK_NON_ADMIN_SET_TAN_CHANNEL: return i18n.str`Only admin can create accounts with second factor authentication.`; case TalerErrorCode.BANK_PASSWORD_TOO_SHORT: - return i18n.str`Password is too short.`; + return i18n.str`The password is too short.`; case TalerErrorCode.BANK_PASSWORD_TOO_LONG: - return i18n.str`Password is too long.`; + return i18n.str`The password is too long.`; } }); } diff --git a/packages/bank-ui/src/pages/SolveChallengePage.tsx b/packages/bank-ui/src/pages/SolveChallengePage.tsx @@ -111,7 +111,7 @@ export function SolveChallengePage({ case HttpStatusCode.NotFound: return notify({ type: "error", - title: i18n.str`Cashout not found. It may be also mean that it was already aborted.`, + title: i18n.str`No cashout was found. The cashout process has probably already been aborted.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -119,7 +119,7 @@ export function SolveChallengePage({ case HttpStatusCode.Unauthorized: return notify({ type: "error", - title: i18n.str`Cashout not found. It may be also mean that it was already aborted.`, + title: i18n.str`No cashout was found. The cashout process has probably already been aborted.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -127,7 +127,7 @@ export function SolveChallengePage({ case TalerErrorCode.BANK_TAN_CHANNEL_SCRIPT_FAILED: return notify({ type: "error", - title: i18n.str`Cashout not found. It may be also mean that it was already aborted.`, + title: i18n.str`No cashout was found. The cashout process has probably already been aborted.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -331,7 +331,8 @@ export function SolveChallengePage({ case TalerCorebankApi.TanChannel.SMS: return ( <i18n.Translate> - You should have received a code in your phone. + You should have received a code on your mobile + phone. </i18n.Translate> ); case TalerCorebankApi.TanChannel.EMAIL: @@ -710,14 +711,14 @@ function ShowWithdrawalDetails({ spec={config.currency_specification} /> ) : ( - <i18n.Translate>No amount specified yet.</i18n.Translate> + <i18n.Translate>No amount has yet been determined.</i18n.Translate> )} </dd> </div> {details.body.selected_reserve_pub !== undefined && ( <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"> - <i18n.Translate>Withdraw id</i18n.Translate> + <i18n.Translate>Withdraw reserve ID</i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0" @@ -759,10 +760,10 @@ function ShowCashoutDetails({ switch (info.case) { case HttpStatusCode.NotImplemented: { return ( - <Attention type="danger" title={i18n.str`Cashout are disabled`}> + <Attention type="danger" title={i18n.str`Cashout is disabled`}> <i18n.Translate> - Cashout should be enable by configuration and the conversion rate - should be initialized with fee, ratio and rounding mode. + Cashout should be enabled in the configuration, the conversion + rate should be initialized with fee(s), rates and a rounding mode. </i18n.Translate> </Attention> ); diff --git a/packages/bank-ui/src/pages/WalletWithdrawForm.tsx b/packages/bank-ui/src/pages/WalletWithdrawForm.tsx @@ -53,12 +53,16 @@ import { useWithdrawalDetails } from "../hooks/account.js"; const RefAmount = forwardRef(InputAmount); -function ThereIsAnOperationWarning({ wopid, onClose, focus, routeOperationDetails }: { - focus?: boolean, - wopid: string, +function ThereIsAnOperationWarning({ + wopid, + onClose, + focus, + routeOperationDetails, +}: { + focus?: boolean; + wopid: string; onClose: () => void; routeOperationDetails: RouteDefinition<{ wopid: string }>; - }): VNode { const { i18n } = useTranslationContext(); const url = routeOperationDetails.url({ wopid }); @@ -66,7 +70,7 @@ function ThereIsAnOperationWarning({ wopid, onClose, focus, routeOperationDetail return ( <Attention type="warning" - title={i18n.str`There is an operation already`} + title={i18n.str`There is an operation already pending`} onClose={onClose} > <span ref={focus ? doAutoFocus : undefined} /> @@ -75,18 +79,17 @@ function ThereIsAnOperationWarning({ wopid, onClose, focus, routeOperationDetail class="font-semibold text-yellow-700 hover:text-yellow-600" name="complete operation" href={url} - // onClick={(e) => { - // e.preventDefault() - // walletInegrationApi.publishTalerAction(uri, () => { - // navigateTo(url) - // }) - // }} + // onClick={(e) => { + // e.preventDefault() + // walletInegrationApi.publishTalerAction(uri, () => { + // navigateTo(url) + // }) + // }} > <i18n.Translate>this page</i18n.Translate> </a> </Attention> ); - } function OldWithdrawalForm({ @@ -128,10 +131,7 @@ function OldWithdrawalForm({ const loading = !result; const error = !loading && (result instanceof TalerError || result.type === "fail"); - const pending = - !loading && - !error && - result.body.status === "pending"; + const pending = !loading && !error && result.body.status === "pending"; if (pending) { // FIXME: doing the preventDefault is not optimal @@ -141,43 +141,16 @@ function OldWithdrawalForm({ // withdrawalOperationId: bankState.currentWithdrawalOperationId, // }); // const uri = parseWithdrawUri(suri)! - return <ThereIsAnOperationWarning - onClose={() => { - updateBankState("currentWithdrawalOperationId", undefined); - }} - routeOperationDetails={routeOperationDetails} - wopid={bankState.currentWithdrawalOperationId!} - focus - - /> - // const url = routeOperationDetails.url({ - // wopid: bankState.currentWithdrawalOperationId, - // }); - // return ( - // <Attention - // type="warning" - // title={i18n.str`There is an operation already`} - // onClose={() => { - // updateBankState("currentWithdrawalOperationId", undefined); - // }} - // > - // <span ref={focus ? doAutoFocus : undefined} /> - // <i18n.Translate>Complete the operation in</i18n.Translate>{" "} - // <a - // class="font-semibold text-yellow-700 hover:text-yellow-600" - // name="complete operation" - // href={url} - // // onClick={(e) => { - // // e.preventDefault() - // // walletInegrationApi.publishTalerAction(uri, () => { - // // navigateTo(url) - // // }) - // // }} - // > - // <i18n.Translate>this page</i18n.Translate> - // </a> - // </Attention> - // ); + return ( + <ThereIsAnOperationWarning + onClose={() => { + updateBankState("currentWithdrawalOperationId", undefined); + }} + routeOperationDetails={routeOperationDetails} + wopid={bankState.currentWithdrawalOperationId!} + focus + /> + ); } const trimmedAmountStr = amountStr?.trim(); @@ -203,17 +176,17 @@ function OldWithdrawalForm({ const params: TalerCorebankApi.BankAccountCreateWithdrawalRequest = preference.fastWithdrawalForm ? { - suggested_amount: Amounts.stringify(parsedAmount), - } + suggested_amount: Amounts.stringify(parsedAmount), + } : { - amount: Amounts.stringify(parsedAmount), - }; + amount: Amounts.stringify(parsedAmount), + }; const resp = await api.createWithdrawal(creds, params); if (resp.type === "ok") { const uri = parseWithdrawUri(resp.body.taler_withdraw_uri); if (!uri) { return notifyError( - i18n.str`Server responded with an invalid withdraw URI`, + i18n.str`The server replied with an invalid taler://withdraw URI`, i18n.str`Withdraw URI: ${resp.body.taler_withdraw_uri}`, ); } else { @@ -229,7 +202,7 @@ function OldWithdrawalForm({ notify({ type: "error", title: i18n.str`The operation was rejected due to insufficient funds`, - description: resp.detail?.hint as TranslatedString , + description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), }); @@ -239,7 +212,7 @@ function OldWithdrawalForm({ notify({ type: "error", title: i18n.str`The operation was rejected due to insufficient funds`, - description: resp.detail?.hint as TranslatedString , + description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), }); @@ -249,7 +222,7 @@ function OldWithdrawalForm({ notify({ type: "error", title: i18n.str`Account not found`, - description: resp.detail?.hint as TranslatedString , + description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), }); @@ -287,7 +260,10 @@ function OldWithdrawalForm({ ref={focus ? doAutoFocus : undefined} /> </div> - <ShowInputErrorLabel message={errors?.amount} isDirty={amountStr !== undefined} /> + <ShowInputErrorLabel + message={errors?.amount} + isDirty={amountStr !== undefined} + /> </div> <p class="mt-2 text-sm text-gray-500"> <i18n.Translate> @@ -461,7 +437,7 @@ export function WalletWithdrawForm({ routeClose={routeCancel} routeHere={routeOperationDetails} onAbort={onOperationAborted} - // route={routeCancel} + // route={routeCancel} /> )} </div> diff --git a/packages/bank-ui/src/pages/WireTransfer.tsx b/packages/bank-ui/src/pages/WireTransfer.tsx @@ -114,7 +114,7 @@ export function WireTransfer({ limit={limit} onAuthorizationRequired={onAuthorizationRequired} onSuccess={() => { - notifyInfo(i18n.str`Wire transfer created!`); + notifyInfo(i18n.str`The wire transfer was successfully completed!`); if (onSuccess) onSuccess(); }} routeCancel={routeCancel} diff --git a/packages/bank-ui/src/pages/WithdrawalConfirmationQuestion.tsx b/packages/bank-ui/src/pages/WithdrawalConfirmationQuestion.tsx @@ -124,7 +124,7 @@ export function WithdrawalConfirmationQuestion({ case HttpStatusCode.BadRequest: return notify({ type: "error", - title: i18n.str`The operation id is invalid.`, + title: i18n.str`The operation ID is invalid.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -140,7 +140,7 @@ export function WithdrawalConfirmationQuestion({ case TalerErrorCode.BANK_UNALLOWED_DEBIT: return notify({ type: "error", - title: i18n.str`Your balance is not enough for the operation.`, + title: i18n.str`Your balance is not sufficient for the operation.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -204,7 +204,7 @@ export function WithdrawalConfirmationQuestion({ case HttpStatusCode.BadRequest: return notify({ type: "error", - title: i18n.str`The operation id is invalid.`, + title: i18n.str`The operation ID is invalid.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -260,7 +260,7 @@ export function WithdrawalConfirmationQuestion({ <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"> <i18n.Translate> - Payment provider's account + Payment Service Provider's account </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -278,7 +278,8 @@ export function WithdrawalConfirmationQuestion({ <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"> <i18n.Translate> - Payment provider's account number + Payment Service Provider's account + number </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -289,7 +290,7 @@ export function WithdrawalConfirmationQuestion({ <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"> <i18n.Translate> - Payment provider's name + Payment Service Provider's name </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -308,8 +309,8 @@ export function WithdrawalConfirmationQuestion({ <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"> <i18n.Translate> - Payment provider's account bank - hostname + Payment Service Provider's account + bank hostname </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -319,7 +320,7 @@ export function WithdrawalConfirmationQuestion({ <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"> <i18n.Translate> - Payment provider's account id + Payment Service Provider's account id </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -330,7 +331,7 @@ export function WithdrawalConfirmationQuestion({ <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"> <i18n.Translate> - Payment provider's name + Payment Service Provider's name </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -349,7 +350,8 @@ export function WithdrawalConfirmationQuestion({ <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"> <i18n.Translate> - Payment provider's account address + Payment Service Provider's account + address </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -360,7 +362,7 @@ export function WithdrawalConfirmationQuestion({ <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"> <i18n.Translate> - Payment provider's name + Payment Service Provider's name </i18n.Translate> </dt> <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"> @@ -388,7 +390,7 @@ export function WithdrawalConfirmationQuestion({ /> ) : ( <i18n.Translate> - No amount specified yet. + No amount has yet been determined. </i18n.Translate> )} </dd> @@ -468,7 +470,7 @@ export function ShouldBeSameUser({ <Fragment> <Attention type="warning" - title={i18n.str`This operation was created with other username`} + title={i18n.str`This operation was created with another username`} /> <LoginForm currentUser={username} fixedUser /> </Fragment> diff --git a/packages/bank-ui/src/pages/WithdrawalQRCode.tsx b/packages/bank-ui/src/pages/WithdrawalQRCode.tsx @@ -106,8 +106,9 @@ export function WithdrawalQRCode({ <div class="mt-2"> <p class="text-sm text-gray-500"> <i18n.Translate> - The wire transfer to the payment provider's account was - aborted from somewhere else, your balance was not affected. + The wire transfer to the Payment Service Provider's account + was aborted from somewhere else, your balance was not + affected. </i18n.Translate> </p> </div> @@ -157,9 +158,9 @@ export function WithdrawalQRCode({ <div class="mt-2"> <p class="text-sm text-gray-500"> <i18n.Translate> - The wire transfer to the Taler operator has been initiated. - You will soon receive the requested amount in your Taler - wallet. + The wire transfer to the Payment Service Provider has been + initiated. You will shortly receive the requested amount in + your Taler wallet.{" "} </i18n.Translate> </p> </div> @@ -173,13 +174,13 @@ export function WithdrawalQRCode({ > <i18n.Translate>Close</i18n.Translate> </a> - {origin === "from-wallet-ui" ? ( + {origin === "from-wallet-ui" && false ? ( <a href={talerWithdrawUri} name="done" class="inline-flex justify-center 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>Go to wallet</i18n.Translate> + <i18n.Translate>Go to your wallet now</i18n.Translate> </a> ) : undefined} </div> @@ -192,7 +193,7 @@ export function WithdrawalQRCode({ <QrCodeSection withdrawUri={withdrawUri} onAborted={() => { - notifyInfo(i18n.str`Operation canceled`); + notifyInfo(i18n.str`Operation aborted`); onOperationAborted(); }} /> @@ -207,10 +208,10 @@ export function WithdrawalQRCode({ return ( <Attention type="danger" - title={i18n.str`The operation is marked as 'selected' but some step in the withdrawal failed`} + title={i18n.str`The operation is marked as selected, but a process during the withdrawal failed`} > <i18n.Translate> - The account is selected but no withdrawal identification found. + The account was selected, but no withdrawal reserve ID was found. </i18n.Translate> </Attention> ); @@ -220,11 +221,11 @@ export function WithdrawalQRCode({ return ( <Attention type="danger" - title={i18n.str`The operation is marked as 'selected' but some step in the withdrawal failed`} + title={i18n.str`The operation is marked as selected, but a process during the withdrawal failed`} > <i18n.Translate> - There is a withdrawal identification but no account has been selected - or the selected account is invalid. + There is a withdrawal reserve ID but no account has been selected or + the selected account is invalid. </i18n.Translate> </Attention> ); @@ -234,11 +235,11 @@ export function WithdrawalQRCode({ return ( <Attention type="danger" - title={i18n.str`The operation is marked as 'selected' but some step in the withdrawal failed`} + title={i18n.str`The operation is marked as selected, but a process during the withdrawal failed`} > <i18n.Translate> - No withdrawal ID found and no account has been selected or the - selected account is invalid. + A withdrawal reserve ID was not found and the no account has been + selected. </i18n.Translate> </Attention> ); @@ -256,7 +257,7 @@ export function WithdrawalQRCode({ }} onAuthorizationRequired={onAuthorizationRequired} onAborted={() => { - notifyInfo(i18n.str`Operation canceled`); + notifyInfo(i18n.str`Operation aborted`); onOperationAborted(); }} /> @@ -299,9 +300,9 @@ export function OperationNotFound({ <div class="mt-2"> <p class="text-sm text-gray-500"> <i18n.Translate> - This operation is not known by the server. The operation id is - wrong or the server deleted the operation information before - reaching here. + This process is not known to the server. The process ID is + incorrect or the server has deleted the process information + before it arrived here. </i18n.Translate> </p> </div> @@ -314,7 +315,7 @@ export function OperationNotFound({ name="continue to dashboard" class="inline-flex w-full justify-center 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>Cotinue to dashboard</i18n.Translate> + <i18n.Translate>Continue to dashboard</i18n.Translate> </a> </div> )} diff --git a/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx b/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx @@ -204,7 +204,7 @@ export function ShowAccountDetails({ case TalerErrorCode.BANK_PASSWORD_TOO_SHORT: { return notify({ type: "error", - title: i18n.str`Password is too short.`, + title: i18n.str`The password is too short.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -213,7 +213,7 @@ export function ShowAccountDetails({ case TalerErrorCode.BANK_PASSWORD_TOO_LONG: { return notify({ type: "error", - title: i18n.str`Password is too long.`, + title: i18n.str`The password is too long.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), diff --git a/packages/bank-ui/src/pages/admin/AccountForm.tsx b/packages/bank-ui/src/pages/admin/AccountForm.tsx @@ -197,7 +197,7 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({ : !newForm.phone.startsWith("+") // FIXME: better phone number check ? i18n.str`Should start with +` : !REGEX_JUST_NUMBERS_REGEX.test(newForm.phone) - ? i18n.str`Phone number can't have other than numbers` + ? i18n.str`A phone number consists of numbers only` : undefined, debit_threshold: !editableThreshold ? undefined @@ -373,7 +373,7 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({ /> </div> <p class="mt-2 text-sm text-gray-500"> - <i18n.Translate>Account id for authentication</i18n.Translate> + <i18n.Translate>Account ID for authentication</i18n.Translate> </p> </div> @@ -417,8 +417,8 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({ label={i18n.str`Internal account`} help={ purpose === "create" - ? i18n.str`If empty a random account id will be assigned` - : i18n.str`Share this id to receive bank transfers` + ? i18n.str`If this field is empty, a random account ID will be assigned` + : i18n.str`You can copy and share this IBAN number in order to receive wire transfers to your bank account` } error={errors?.payto_uri} onChange={(e) => { @@ -641,7 +641,7 @@ export function AccountForm<PurposeType extends keyof ChangeByPurposeType>({ id="availability-label" > <i18n.Translate> - Is this account a payment provider? + Does this account belong to a Payment Service Provider? </i18n.Translate> </span> </span> diff --git a/packages/bank-ui/src/pages/admin/AdminHome.tsx b/packages/bank-ui/src/pages/admin/AdminHome.tsx @@ -30,10 +30,7 @@ import { useBankCoreApiContext, useTranslationContext, } from "@gnu-taler/web-util/browser"; -import { - format, - sub -} from "date-fns"; +import { format, sub } from "date-fns"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; import { ErrorLoadingWithDebug } from "../../components/ErrorLoadingWithDebug.js"; @@ -98,7 +95,7 @@ function getDateForTimeframeStart( ): string { if (date.t_ms === "never") return "--"; switch (timeframe) { - case TalerCorebankApi.MonitorTimeframeParam.hour: + case TalerCorebankApi.MonitorTimeframeParam.hour: return `${format(date.t_ms, "HH:00", { locale })}hs`; case TalerCorebankApi.MonitorTimeframeParam.day: return format(date.t_ms, "EEEE", { locale }); @@ -120,28 +117,48 @@ function getDateForTimeframeEnd( if (date.t_ms === "never") return "--"; switch (timeframe) { case TalerCorebankApi.MonitorTimeframeParam.hour: { - const end = AbsoluteTime.addDuration(date, Duration.fromSpec({hours: 1})) - if (end.t_ms === "never") throw Error(`abs time plus 1 hour duration can't be 'never'`) + const end = AbsoluteTime.addDuration( + date, + Duration.fromSpec({ hours: 1 }), + ); + if (end.t_ms === "never") + throw Error(`abs time plus 1 hour duration can't be 'never'`); return `${format(end.t_ms, "HH:00", { locale })}hs`; } case TalerCorebankApi.MonitorTimeframeParam.day: { - const end = AbsoluteTime.addDuration(date, Duration.fromSpec({days: 1})) - if (end.t_ms === "never") throw Error(`abs time plus 1 day duration can't be 'never'`) + const end = AbsoluteTime.addDuration( + date, + Duration.fromSpec({ days: 1 }), + ); + if (end.t_ms === "never") + throw Error(`abs time plus 1 day duration can't be 'never'`); return format(end.t_ms, "EEEE", { locale }); } case TalerCorebankApi.MonitorTimeframeParam.month: { - const end = AbsoluteTime.addDuration(date, Duration.fromSpec({months: 1})) - if (end.t_ms === "never") throw Error(`abs time plus 1 month duration can't be 'never'`) + const end = AbsoluteTime.addDuration( + date, + Duration.fromSpec({ months: 1 }), + ); + if (end.t_ms === "never") + throw Error(`abs time plus 1 month duration can't be 'never'`); return format(end.t_ms, "MMMM", { locale }); } case TalerCorebankApi.MonitorTimeframeParam.year: { - const end = AbsoluteTime.addDuration(date, Duration.fromSpec({years: 1})) - if (end.t_ms === "never") throw Error(`abs time plus 1 year duration can't be 'never'`) + const end = AbsoluteTime.addDuration( + date, + Duration.fromSpec({ years: 1 }), + ); + if (end.t_ms === "never") + throw Error(`abs time plus 1 year duration can't be 'never'`); return format(end.t_ms, "yyyy", { locale }); } case TalerCorebankApi.MonitorTimeframeParam.decade: { - const end = AbsoluteTime.addDuration(date, Duration.fromSpec({years: 10})) - if (end.t_ms === "never") throw Error(`abs time plus 10 years duration can't be 'never'`) + const end = AbsoluteTime.addDuration( + date, + Duration.fromSpec({ years: 10 }), + ); + if (end.t_ms === "never") + throw Error(`abs time plus 10 years duration can't be 'never'`); return format(end.t_ms, "yyyy", { locale }); } } @@ -230,10 +247,10 @@ function Metrics({ switch (respInfo.case) { case HttpStatusCode.NotImplemented: { return ( - <Attention type="danger" title={i18n.str`Cashout are disabled`}> + <Attention type="danger" title={i18n.str`Cashout is disabled`}> <i18n.Translate> - Cashout should be enable by configuration and the conversion rate - should be initialized with fee, ratio and rounding mode. + Cashout should be enabled in the configuration, the conversion + rate should be initialized with fee(s), rates and a rounding mode. </i18n.Translate> </Attention> ); @@ -314,8 +331,10 @@ function Metrics({ class="block w-full rounded-md border-gray-300 focus:border-indigo-500 focus:ring-indigo-500" onChange={(e) => { setMetricType( - parseInt(e.currentTarget - .value, 10) as TalerCorebankApi.MonitorTimeframeParam, + parseInt( + e.currentTarget.value, + 10, + ) as TalerCorebankApi.MonitorTimeframeParam, ); }} > diff --git a/packages/bank-ui/src/pages/admin/CreateNewAccount.tsx b/packages/bank-ui/src/pages/admin/CreateNewAccount.tsx @@ -117,7 +117,7 @@ export function CreateNewAccount({ case TalerErrorCode.BANK_NON_ADMIN_PATCH_DEBT_LIMIT: return notify({ type: "error", - title: i18n.str`Only admin is allow to set debt limit.`, + title: i18n.str`Only an administrator is allowed to set the debt limit.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -158,7 +158,7 @@ export function CreateNewAccount({ case TalerErrorCode.BANK_PASSWORD_TOO_SHORT: { return notify({ type: "error", - title: i18n.str`Password is too short.`, + title: i18n.str`The password is too short.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -167,7 +167,7 @@ export function CreateNewAccount({ case TalerErrorCode.BANK_PASSWORD_TOO_LONG: { return notify({ type: "error", - title: i18n.str`Password is too long.`, + title: i18n.str`The password is too long.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), diff --git a/packages/bank-ui/src/pages/regional/CreateCashout.tsx b/packages/bank-ui/src/pages/regional/CreateCashout.tsx @@ -148,10 +148,10 @@ export function CreateCashout({ switch (info.case) { case HttpStatusCode.NotImplemented: { return ( - <Attention type="danger" title={i18n.str`Cashout are disabled`}> + <Attention type="danger" title={i18n.str`Cashout is disabled`}> <i18n.Translate> - Cashout should be enable by configuration and the conversion rate - should be initialized with fee, ratio and rounding mode. + Cashout should be enabled in the configuration, the conversion + rate should be initialized with fee(s), rates and a rounding mode. </i18n.Translate> </Attention> ); @@ -250,7 +250,7 @@ export function CreateCashout({ : calculationResult === "amount-is-too-small" ? i18n.str`Amount needs to be higher` : Amounts.cmp(calc.debit, conversionInfo.cashout_min_amount) < 0 - ? i18n.str`No account can't cashout less than ${ + ? i18n.str`It is not possible to cashout less than ${ Amounts.stringifyValueWithSpec( Amounts.parseOrThrow(conversionInfo.cashout_min_amount), regional_currency_specification, @@ -264,7 +264,7 @@ export function CreateCashout({ ).normal }` : Amounts.isZero(calc.credit) - ? i18n.str`The total transfer at destination will be zero` + ? i18n.str`The total transfer to the destination will be zero` : undefined, }); const trimmedAmountStr = form.amount?.trim(); @@ -314,7 +314,7 @@ export function CreateCashout({ case TalerErrorCode.BANK_BAD_CONVERSION: return notify({ type: "error", - title: i18n.str`The conversion rate was incorrectly applied`, + title: i18n.str`The conversion rate was applied incorrectly`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -330,7 +330,7 @@ export function CreateCashout({ case HttpStatusCode.NotImplemented: return notify({ type: "error", - title: i18n.str`Cashout are disabled`, + title: i18n.str`Cashout is disabled`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -346,7 +346,7 @@ export function CreateCashout({ case TalerErrorCode.BANK_CONVERSION_AMOUNT_TO_SMALL: return notify({ type: "error", - title: i18n.str`The amount is less than the minimum allowed.`, + title: i18n.str`The amount is below the minimum amount permitted.`, description: resp.detail?.hint as TranslatedString, debug: resp.detail, when: AbsoluteTime.now(), @@ -453,7 +453,7 @@ export function CreateCashout({ </div> <p class="mt-2 text-sm text-gray-500"> <i18n.Translate> - If this name doesn't match the account holder's name your + If this name doesn't match the account holder's name, your transaction may fail. </i18n.Translate> </p> @@ -462,7 +462,8 @@ export function CreateCashout({ <div class="flex items-center justify-between border-t-2 afu pt-4"> <Attention type="warning" title={i18n.str`No cashout account`}> <i18n.Translate> - Before doing a cashout you need to complete your profile + Before being able to cashout to a bank account, you need to + complete your profile </i18n.Translate> </Attention> </div> diff --git a/packages/bank-ui/src/pages/regional/ShowCashoutDetails.tsx b/packages/bank-ui/src/pages/regional/ShowCashoutDetails.tsx @@ -68,10 +68,10 @@ export function ShowCashoutDetails({ id, routeClose }: Props): VNode { ); case HttpStatusCode.NotImplemented: return ( - <Attention type="warning" title={i18n.str`Cashout are disabled`}> + <Attention type="warning" title={i18n.str`Cashout is disabled`}> <i18n.Translate> - Cashout should be enable by configuration and the conversion rate - should be initialized with fee, ratio and rounding mode. + Cashout should be enabled in the configuration, the conversion + rate should be initialized with fee(s), rates and a rounding mode. </i18n.Translate> </Attention> ); @@ -90,10 +90,10 @@ export function ShowCashoutDetails({ id, routeClose }: Props): VNode { switch (info.case) { case HttpStatusCode.NotImplemented: { return ( - <Attention type="danger" title={i18n.str`Cashout are disabled`}> + <Attention type="danger" title={i18n.str`Cashout is disabled`}> <i18n.Translate> - Cashout should be enable by configuration and the conversion rate - should be initialized with fee, ratio and rounding mode. + Cashout should be enabled in the configuration, the conversion + rate should be initialized with fee(s), rates and a rounding mode. </i18n.Translate> </Attention> ); diff --git a/packages/bank-ui/src/utils.ts b/packages/bank-ui/src/utils.ts @@ -120,7 +120,6 @@ export enum CashoutStatus { PENDING = "pending", } - export const PAGINATED_LIST_SIZE = 5; // when doing paginated request, ask for one more // and use it to know if there are more to request @@ -384,7 +383,7 @@ export function validateIBAN( i18n: InternationalizationAPI, ): TranslatedString | undefined { if (!IBAN_REGEX.test(account)) { - return i18n.str`IBAN only have uppercased letters and numbers`; + return i18n.str`An IBAN consists of capital letters and numbers only`; } // Check total length if (account.length < 4) return i18n.str`IBAN numbers have more that 4 digits`;