commit 223aba5a23491ae19d5ae5afa19d97027ced1355 parent b7eb63a834607791ecb87496428dc15aa1f2dea2 Author: Sebastian <sebasjm@gmail.com> Date: Mon, 4 Nov 2024 18:42:48 -0300 fixing strings in source thanks to stefan Diffstat:
26 files changed, 131 insertions(+), 118 deletions(-)
diff --git a/packages/merchant-backoffice-ui/src/components/modal/index.tsx b/packages/merchant-backoffice-ui/src/components/modal/index.tsx @@ -800,7 +800,7 @@ export function UpdateTokenModal({ const { state } = useSessionContext(); - const text = i18n.str`You are updating the access token from instance with id ${state.instance}`; + const text = i18n.str`You are updating the access token for the instance with id ${state.instance}`; return ( <ClearConfirmModal diff --git a/packages/merchant-backoffice-ui/src/paths/admin/list/TableActive.tsx b/packages/merchant-backoffice-ui/src/paths/admin/list/TableActive.tsx @@ -20,9 +20,7 @@ */ import { TalerMerchantApi } from "@gnu-taler/taler-util"; -import { - useTranslationContext -} from "@gnu-taler/web-util/browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { VNode, h } from "preact"; import { StateUpdater, useEffect, useState } from "preact/hooks"; import { useSessionContext } from "../../../context/session.js"; @@ -261,7 +259,7 @@ function EmptyTable(): VNode { </p> <p> <i18n.Translate> - There is no instances yet, add more pressing the + sign + There are no instances yet, add more pressing the + sign </i18n.Translate> </p> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/admin/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/admin/list/index.tsx @@ -137,7 +137,7 @@ export default function Instances({ onCreate, onUpdate }: Props): VNode { ); if (resp.type === "ok") { setNotif({ - message: i18n.str`Instance '${purging.name}' (ID: ${purging.id}) has been purge`, + message: i18n.str`Instance '${purging.name}' (ID: ${purging.id}) has been purged`, type: "SUCCESS", }); } else { diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx @@ -27,7 +27,7 @@ import { TalerRevenueApi, TranslatedString, assertUnreachable, - parsePaytoUri + parsePaytoUri, } from "@gnu-taler/taler-util"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; @@ -170,7 +170,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { } case HttpStatusCode.NotFound: { setTestError( - i18n.str`The endpoint doesn't seems to be a Taler Revenue API.`, + i18n.str`The endpoint does not seem to be a Taler Revenue API.`, ); setState({ ...state, diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/list/Table.tsx @@ -142,10 +142,10 @@ function Table({ accounts, onDelete, onSelect }: TableProps): VNode { <i18n.Translate>Address</i18n.Translate> </th> <th> - <i18n.Translate>Sewgit 1</i18n.Translate> + <i18n.Translate>SegWit 1</i18n.Translate> </th> <th> - <i18n.Translate>Sewgit 2</i18n.Translate> + <i18n.Translate>SegWit 2</i18n.Translate> </th> <th /> </tr> @@ -365,7 +365,7 @@ function EmptyTable(): VNode { </p> <p> <i18n.Translate> - There is no accounts yet, add more pressing the + sign + There are no accounts yet, add more pressing the + sign </i18n.Translate> </p> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/list/index.tsx @@ -95,7 +95,7 @@ export default function ListOtpDevices({ onCreate, onSelect }: Props): VNode { .then((resp) => { if (resp.type === "ok") { setNotif({ - message: i18n.str`Bank account delete successfully`, + message: i18n.str`The bank account has been successfully deleted.`, type: "SUCCESS", }); } else { @@ -110,7 +110,8 @@ export default function ListOtpDevices({ onCreate, onSelect }: Props): VNode { setNotif({ message: i18n.str`Could not delete the bank account`, type: "ERROR", - description: error instanceof Error ? error.message : String(error), + description: + error instanceof Error ? error.message : String(error), }), ); }} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/update/UpdatePage.tsx @@ -221,7 +221,7 @@ export function UpdatePage({ } case HttpStatusCode.NotFound: { setTestError( - i18n.str`The endpoint doesn't seems to be a Taler Revenue API.`, + i18n.str`The endpoint does not seem to be a Taler Revenue API.`, ); setState({ ...state, diff --git a/packages/merchant-backoffice-ui/src/paths/instance/categories/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/categories/create/CreatePage.tsx @@ -19,9 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { - TalerMerchantApi -} from "@gnu-taler/taler-util"; +import { TalerMerchantApi } from "@gnu-taler/taler-util"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { VNode, h } from "preact"; import { useState } from "preact/hooks"; @@ -43,13 +41,13 @@ interface Props { export function CreatePage({ onCreate, onBack }: Props): VNode { const { i18n } = useTranslationContext(); - const [state, setState] = useState<Partial<Entity>>({name_i18n: {}}); + const [state, setState] = useState<Partial<Entity>>({ name_i18n: {} }); const errors = undefinedIfEmpty<FormErrors<Entity>>({ name: !state.name ? i18n.str`Required` : !/[a-zA-Z0-9]*/.test(state.name) - ? i18n.str`Invalid. Only characters and numbers` + ? i18n.str`Invalid. Please insert only characters and numbers` : undefined, }); diff --git a/packages/merchant-backoffice-ui/src/paths/instance/categories/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/categories/list/Table.tsx @@ -197,7 +197,7 @@ function EmptyTable(): VNode { </p> <p> <i18n.Translate> - There is no categories yet, add more pressing the + sign + There are no categories yet, add more pressing the + sign </i18n.Translate> </p> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx @@ -492,7 +492,7 @@ export function CreatePage({ {pref.advanceOrderMode && ( <InputGroup name="shipping" - label={i18n.str`Shipping and Fulfillment`} + label={i18n.str`Shipping and fulfillment`} initialActive > <InputDate @@ -647,7 +647,7 @@ export function CreatePage({ <InputToggle name="payments.createToken" label={i18n.str`Create token`} - tooltip={i18n.str`If the order ID is easy to guess the token will prevent user to steal orders from others.`} + tooltip={i18n.str`If the order ID is easy to guess the token will prevent users to steal orders from others.`} /> )} {pref.advanceOrderMode && ( diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx @@ -108,7 +108,7 @@ export default function OrderCreate({ onConfirm, onBack }: Props): VNode { setNotif({ message: i18n.str`Could not create order`, type: "ERROR", - description: i18n.str`No exchange would accept a payment because of KYC requirements.` + description: i18n.str`No exchange would accept a payment because of KYC requirements.`, }); return; } @@ -126,12 +126,12 @@ export default function OrderCreate({ onConfirm, onBack }: Props): VNode { setNotif({ message: i18n.str`Could not create order`, type: "ERROR", - description: i18n.str`No more stock for product with id "${resp.body.product_id}".` + description: i18n.str`No more stock for product with ID "${resp.body.product_id}".`, }); return; } default: { - assertUnreachable(resp) + assertUnreachable(resp); } } } diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/DetailPage.tsx @@ -25,9 +25,7 @@ import { TalerMerchantApi, stringifyRefundUri, } from "@gnu-taler/taler-util"; -import { - useTranslationContext -} from "@gnu-taler/web-util/browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format, formatDistance } from "date-fns"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; @@ -69,7 +67,7 @@ function ContractTerms({ value }: { value: CT }) { const { i18n } = useTranslationContext(); return ( - <InputGroup name="contract_terms" label={i18n.str`Contract Terms`}> + <InputGroup name="contract_terms" label={i18n.str`Contract terms`}> <FormProvider<CT> object={value} valueHandler={null}> <Input<CT> readonly diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/Table.tsx @@ -20,9 +20,7 @@ */ import { Amounts, TalerMerchantApi } from "@gnu-taler/taler-util"; -import { - useTranslationContext -} from "@gnu-taler/web-util/browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { VNode, h } from "preact"; import { StateUpdater, useState } from "preact/hooks"; @@ -210,9 +208,11 @@ function Table({ </tbody> </table> {onLoadMoreAfter && ( - <button class="button is-fullwidth" - data-tooltip={i18n.str`Load more orders after the last one`} - onClick={onLoadMoreAfter}> + <button + class="button is-fullwidth" + data-tooltip={i18n.str`Load more orders after the last one`} + onClick={onLoadMoreAfter} + > <i18n.Translate>Load next page</i18n.Translate> </button> )} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatePage.tsx @@ -58,7 +58,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { otp_device_id: !state.otp_device_id ? i18n.str`Required` : !/[a-zA-Z0-9]*/.test(state.otp_device_id) - ? i18n.str`Invalid. Only characters and numbers` + ? i18n.str`Invalid. Please insert only characters and numbers` : undefined, otp_algorithm: !state.otp_algorithm ? i18n.str`Required` : undefined, otp_key: !state.otp_key @@ -71,7 +71,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { otp_device_description: !state.otp_device_description ? i18n.str`Required` : !/[a-zA-Z0-9]*/.test(state.otp_device_description) - ? i18n.str`Invalid. Only characters and numbers` + ? i18n.str`Invalid. Please insert only characters and numbers` : undefined, }); diff --git a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/list/Table.tsx @@ -188,7 +188,7 @@ function EmptyTable(): VNode { </p> <p> <i18n.Translate> - There is no devices yet, add more pressing the + sign + There is are devices yet, add more pressing the + sign </i18n.Translate> </p> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/list/Table.tsx @@ -31,7 +31,10 @@ import { } from "../../../../components/form/FormProvider.js"; import { InputCurrency } from "../../../../components/form/InputCurrency.js"; import { InputNumber } from "../../../../components/form/InputNumber.js"; -import { dateFormatForSettings, usePreference } from "../../../../hooks/preference.js"; +import { + dateFormatForSettings, + usePreference, +} from "../../../../hooks/preference.js"; import { WithId } from "../../../../declaration.js"; type Entity = TalerMerchantApi.ProductDetail & WithId; @@ -57,7 +60,7 @@ export function CardTable({ onUpdate, onDelete, onLoadMoreAfter, - onLoadMoreBefore + onLoadMoreBefore, }: Props): VNode { const [rowSelection, rowSelectionHandler] = useState<string | undefined>( undefined, @@ -130,7 +133,7 @@ function Table({ onUpdate, onDelete, onLoadMoreAfter, - onLoadMoreBefore + onLoadMoreBefore, }: TableProps): VNode { const { i18n } = useTranslationContext(); const [settings] = usePreference(); @@ -175,9 +178,9 @@ function Table({ : i.next_restock.t_s === "never" ? "never" : `restock at ${format( - new Date(i.next_restock.t_s * 1000), - dateFormatForSettings(settings), - )}`; + new Date(i.next_restock.t_s * 1000), + dateFormatForSettings(settings), + )}`; let stockInfo: ComponentChildren = ""; if (i.total_stock < 0) { stockInfo = "infinite"; @@ -219,7 +222,9 @@ function Table({ } style={{ cursor: "pointer" }} > - {i.description.length > 30 ? i.description.substring(0, 30) + "..." : i.description} + {i.description.length > 30 + ? i.description.substring(0, 30) + "..." + : i.description} </td> <td onClick={() => @@ -259,8 +264,7 @@ function Table({ } style={{ cursor: "pointer" }} > - <span style={{ "whiteSpace": "nowrap" }}> - + <span style={{ whiteSpace: "nowrap" }}> {i.total_sold} {i.unit} </span> </td> @@ -314,9 +318,11 @@ function Table({ </tbody> </table> {onLoadMoreAfter && ( - <button class="button is-fullwidth" - data-tooltip={i18n.str`Load more products after the last one`} - onClick={onLoadMoreAfter}> + <button + class="button is-fullwidth" + data-tooltip={i18n.str`Load more products after the last one`} + onClick={onLoadMoreAfter} + > <i18n.Translate>Load next page</i18n.Translate> </button> )} @@ -326,9 +332,7 @@ function Table({ interface FastProductUpdateFormProps { product: Entity; - onUpdate: ( - data: TalerMerchantApi.ProductPatchDetail, - ) => Promise<void>; + onUpdate: (data: TalerMerchantApi.ProductPatchDetail) => Promise<void>; onCancel: () => void; } interface FastProductUpdate { @@ -363,7 +367,6 @@ function FastProductWithInfiniteStockUpdateForm({ </FormProvider> <div class="buttons is-expanded"> - <div class="buttons is-right mt-5"> <button class="button" onClick={onCancel}> <i18n.Translate>Cancel</i18n.Translate> @@ -407,13 +410,14 @@ function FastProductWithManagedStockUpdateForm({ const errors: FormErrors<FastProductUpdate> = { lost: currentStock + value.incoming < value.lost - ? `lost can't be greater that current + incoming (max ${currentStock + value.incoming - })` + ? `lost can't be greater that current + incoming (max ${ + currentStock + value.incoming + })` : undefined, }; const hasErrors = Object.keys(errors).some( - (k) => (errors as Record<string,unknown>)[k] !== undefined, + (k) => (errors as Record<string, unknown>)[k] !== undefined, ); const { i18n } = useTranslationContext(); @@ -493,7 +497,7 @@ function EmptyTable(): VNode { </p> <p> <i18n.Translate> - There is no products yet, add more pressing the + sign + There are no products yet, add more pressing the + sign </i18n.Translate> </p> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/create/CreatePage.tsx @@ -93,7 +93,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { id: !state.id ? i18n.str`Required` : !/[a-zA-Z0-9]*/.test(state.id) - ? i18n.str`Invalid. only characters and numbers` + ? i18n.str`Invalid. Please insert only characters and numbers` : undefined, description: !state.description ? i18n.str`Required` : undefined, amount: !state.amount @@ -116,7 +116,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { : state.pay_duration.d_ms === "forever" ? undefined : state.pay_duration.d_ms < 1000 //less than one second - ? i18n.str`To short` + ? i18n.str`Too short` : undefined, }; @@ -203,7 +203,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { name="summary" inputType="multiline" label={i18n.str`Summary`} - tooltip={i18n.str`If specified, this template will create order with the same summary`} + tooltip={i18n.str`If specified, this template will create an order with the same summary`} /> <InputToggle<Entity> name="summary_editable" @@ -214,7 +214,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { <InputCurrency<Entity> name="amount" label={i18n.str`Amount`} - tooltip={i18n.str`If specified, this template will create order with the same price`} + tooltip={i18n.str`If specified, this template will create an order with the same price`} /> <InputToggle<Entity> name="amount_editable" @@ -246,7 +246,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { name="pay_duration" label={i18n.str`Payment timeout`} help="" - tooltip={i18n.str`How much time has the customer to complete the payment once the order was created.`} + tooltip={i18n.str`How much time the customer has to complete the payment once the order was created.`} /> {!deviceList.length ? ( <TextField diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/list/Table.tsx @@ -212,7 +212,7 @@ function EmptyTable(): VNode { </p> <p> <i18n.Translate> - There is no templates yet, add more pressing the + sign + There are no templates yet, add more pressing the + sign </i18n.Translate> </p> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/update/UpdatePage.tsx @@ -27,9 +27,7 @@ import { TalerMerchantApi, TranslatedString, } from "@gnu-taler/taler-util"; -import { - useTranslationContext -} from "@gnu-taler/web-util/browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; import { AsyncButton } from "../../../../components/exception/AsyncButton.js"; @@ -76,8 +74,8 @@ export function UpdatePage({ template, onUpdate, onBack }: Props): VNode { otpId: template.otp_id, pay_duration: template.template_contract.pay_duration ? Duration.fromTalerProtocolDuration( - template.template_contract.pay_duration, - ) + template.template_contract.pay_duration, + ) : undefined, summary: template.editable_defaults?.summary ?? template.template_contract.summary, @@ -117,11 +115,15 @@ export function UpdatePage({ template, onUpdate, onBack }: Props): VNode { const errors: FormErrors<Entity> = { description: !state.description ? i18n.str`Required` : undefined, amount: !state.amount - ? state.amount_editable ? undefined : i18n.str`Required` + ? state.amount_editable + ? undefined + : i18n.str`Required` : !parsedPrice ? i18n.str`Invalid` : Amounts.isZero(parsedPrice) - ? state.amount_editable ? undefined : i18n.str`Must be greater than 0` + ? state.amount_editable + ? undefined + : i18n.str`Must be greater than 0` : undefined, minimum_age: state.minimum_age && state.minimum_age < 0 @@ -142,12 +144,14 @@ export function UpdatePage({ template, onUpdate, onBack }: Props): VNode { (k) => (errors as Record<string, unknown>)[k] !== undefined, ); - const zero = Amounts.stringify(Amounts.zeroOfCurrency(config.currency)) + const zero = Amounts.stringify(Amounts.zeroOfCurrency(config.currency)); const submitForm = () => { if (hasErrors) return Promise.reject(); - const contract_amount = state.amount_editable ? undefined : state.amount as AmountString - const contract_summary = state.summary_editable ? undefined : state.summary + const contract_amount = state.amount_editable + ? undefined + : (state.amount as AmountString); + const contract_summary = state.summary_editable ? undefined : state.summary; const template_contract: TalerMerchantApi.TemplateContractDetails = { minimum_age: state.minimum_age!, pay_duration: Duration.toTalerProtocolDuration(state.pay_duration!), @@ -157,13 +161,13 @@ export function UpdatePage({ template, onUpdate, onBack }: Props): VNode { cList.length > 1 && state.currency_editable ? undefined : config.currency, - } + }; return onUpdate({ template_description: state.description!, template_contract, editable_defaults: { - amount: !state.amount_editable ? undefined : (state.amount ?? zero), - summary: !state.summary_editable ? undefined : (state.summary ?? ""), + amount: !state.amount_editable ? undefined : state.amount ?? zero, + summary: !state.summary_editable ? undefined : state.summary ?? "", currency: cList.length === 1 || !state.currency_editable ? undefined @@ -182,7 +186,12 @@ export function UpdatePage({ template, onUpdate, onBack }: Props): VNode { <div class="level-left"> <div class="level-item"> <span class="is-size-4"> - {new URL(`templates/${template.id}`, session.backendUrl.href).href} + { + new URL( + `templates/${template.id}`, + session.backendUrl.href, + ).href + } </span> </div> </div> @@ -219,7 +228,7 @@ export function UpdatePage({ template, onUpdate, onBack }: Props): VNode { <InputCurrency<Entity> name="amount" label={i18n.str`Amount`} - tooltip={i18n.str`If specified, this template will create order with the same price`} + tooltip={i18n.str`If specified, this template will create orders with the same price`} /> <InputToggle<Entity> name="amount_editable" diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/use/UsePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/use/UsePage.tsx @@ -55,8 +55,10 @@ export function UsePage({ id, template, onCreateOrder, onBack }: Props): VNode { }); const errors: FormErrors<Entity> = { - amount: !state.amount ? i18n.str`Amount is required` : undefined, - summary: !state.summary ? i18n.str`Order summary is required` : undefined, + amount: !state.amount ? i18n.str`An amount is required` : undefined, + summary: !state.summary + ? i18n.str`An order summary is required` + : undefined, }; const hasErrors = Object.keys(errors).some( @@ -83,7 +85,7 @@ export function UsePage({ id, template, onCreateOrder, onBack }: Props): VNode { <div class="level-left"> <div class="level-item"> <span class="is-size-4"> - <i18n.Translate>New order for template</i18n.Translate>:{" "} + <i18n.Translate>New order from template</i18n.Translate>:{" "} <b>{id}</b> </span> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/use/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/use/index.tsx @@ -19,18 +19,19 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { HttpStatusCode, TalerError, TalerMerchantApi, assertUnreachable } from "@gnu-taler/taler-util"; import { - useTranslationContext -} from "@gnu-taler/web-util/browser"; + HttpStatusCode, + TalerError, + TalerMerchantApi, + assertUnreachable, +} from "@gnu-taler/taler-util"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; import { ErrorLoadingMerchant } from "../../../../components/ErrorLoadingMerchant.js"; import { Loading } from "../../../../components/exception/loading.js"; import { NotificationCard } from "../../../../components/menu/index.js"; -import { - useTemplateDetails -} from "../../../../hooks/templates.js"; +import { useTemplateDetails } from "../../../../hooks/templates.js"; import { Notification } from "../../../../utils/types.js"; import { LoginPage } from "../../../login/index.js"; import { NotFoundPageOrAdminCreate } from "../../../notfound/index.js"; @@ -54,20 +55,20 @@ export default function TemplateUsePage({ const [notif, setNotif] = useState<Notification | undefined>(undefined); const { i18n } = useTranslationContext(); - if (!result) return <Loading /> + if (!result) return <Loading />; if (result instanceof TalerError) { - return <ErrorLoadingMerchant error={result} /> + return <ErrorLoadingMerchant error={result} />; } if (result.type === "fail") { - switch(result.case) { + switch (result.case) { case HttpStatusCode.NotFound: { - return <NotFoundPageOrAdminCreate /> + return <NotFoundPageOrAdminCreate />; } case HttpStatusCode.Unauthorized: { - return <LoginPage /> + return <LoginPage />; } default: { - assertUnreachable(result) + assertUnreachable(result); } } } @@ -79,20 +80,19 @@ export default function TemplateUsePage({ template={result.body} id={tid} onBack={onBack} - onCreateOrder={( - request: TalerMerchantApi.UsingTemplateDetails, - ) => { - return lib.instance.useTemplateCreateOrder(tid, request) + onCreateOrder={(request: TalerMerchantApi.UsingTemplateDetails) => { + return lib.instance + .useTemplateCreateOrder(tid, request) .then((resp) => { if (resp.type === "ok") { - onOrderCreated(resp.body.order_id) + onOrderCreated(resp.body.order_id); } else { switch (resp.case) { case HttpStatusCode.UnavailableForLegalReasons: { setNotif({ message: i18n.str`Could not create order`, type: "ERROR", - description: i18n.str`No exchange would accept a payment because of KYC requirements.` + description: i18n.str`No exchange would accept a payment because of KYC requirements.`, }); return; } @@ -110,12 +110,12 @@ export default function TemplateUsePage({ setNotif({ message: i18n.str`Could not create order`, type: "ERROR", - description: i18n.str`No more stock for product with id "${resp.body.product_id}".` + description: i18n.str`No more stock for product with ID "${resp.body.product_id}".`, }); return; } default: { - assertUnreachable(resp) + assertUnreachable(resp); } } } @@ -124,7 +124,8 @@ export default function TemplateUsePage({ setNotif({ message: i18n.str`Could not create order from template`, type: "ERROR", - description: error instanceof Error ? error.message : String(error), + description: + error instanceof Error ? error.message : String(error), }); }); }} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/update/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/update/index.tsx @@ -25,9 +25,7 @@ import { TalerMerchantApi, assertUnreachable, } from "@gnu-taler/taler-util"; -import { - useTranslationContext -} from "@gnu-taler/web-util/browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; import { ErrorLoadingMerchant } from "../../../../components/ErrorLoadingMerchant.js"; @@ -97,7 +95,7 @@ export default function UpdateTokenFamily({ .then((resp) => { if (resp.type === "ok") { setNotif({ - message: i18n.str`Token familty updated successfully`, + message: i18n.str`Token family updated successfully`, type: "SUCCESS", }); onConfirm(); @@ -113,7 +111,8 @@ export default function UpdateTokenFamily({ setNotif({ message: i18n.str`Could not update token family`, type: "ERROR", - description: error instanceof Error ? error.message : String(error), + description: + error instanceof Error ? error.message : String(error), }); }); }} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/transfers/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/transfers/create/CreatePage.tsx @@ -94,7 +94,7 @@ export function CreatePage({ accounts, onCreate, onBack }: Props): VNode { name="payto_uri" label={i18n.str`Credited bank account`} values={accounts} - placeholder={i18n.str`Select one account`} + placeholder={i18n.str`Select an account`} tooltip={i18n.str`Bank account of the merchant where the payment was received`} /> <Input<Entity> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/transfers/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/transfers/list/Table.tsx @@ -24,7 +24,10 @@ import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { h, VNode } from "preact"; import { StateUpdater, useState } from "preact/hooks"; -import { datetimeFormatForSettings, usePreference } from "../../../../hooks/preference.js"; +import { + datetimeFormatForSettings, + usePreference, +} from "../../../../hooks/preference.js"; import { WithId } from "../../../../declaration.js"; type Entity = TalerMerchantApi.TransferDetails & WithId; @@ -136,7 +139,7 @@ function Table({ <i18n.Translate>Verified</i18n.Translate> </th> <th> - <i18n.Translate>Executed at</i18n.Translate> + <i18n.Translate>Executed on</i18n.Translate> </th> <th /> </tr> @@ -145,7 +148,7 @@ function Table({ {instances.map((i) => { return ( <tr key={i.id}> - <td title={i.wtid}>{i.wtid.substring(0,16)}...</td> + <td title={i.wtid}>{i.wtid.substring(0, 16)}...</td> <td>{i.credit_amount}</td> <td>{i.confirmed ? i18n.str`yes` : i18n.str`no`}</td> <td>{i.verified ? i18n.str`yes` : i18n.str`no`}</td> @@ -154,9 +157,9 @@ function Table({ ? i.execution_time.t_s == "never" ? i18n.str`never` : format( - i.execution_time.t_s * 1000, - datetimeFormatForSettings(settings), - ) + i.execution_time.t_s * 1000, + datetimeFormatForSettings(settings), + ) : i18n.str`unknown`} </td> <td> @@ -199,7 +202,7 @@ function EmptyTable(): VNode { </p> <p> <i18n.Translate> - There is no transfer yet, add more pressing the + sign + There are no transfers yet, add more pressing the + sign </i18n.Translate> </p> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/webhooks/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/webhooks/list/Table.tsx @@ -188,7 +188,7 @@ function EmptyTable(): VNode { </p> <p> <i18n.Translate> - There is no webhooks yet, add more pressing the + sign + There are no webhooks yet, add more pressing the + sign </i18n.Translate> </p> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/login/index.tsx b/packages/merchant-backoffice-ui/src/paths/login/index.tsx @@ -67,7 +67,7 @@ export function LoginPage(_p: Props): VNode { } case HttpStatusCode.NotFound: { setNotif({ - message: i18n.str`Your instance not found`, + message: i18n.str`Your instance cannot be found`, type: "ERROR", }); return;