commit dabe20d79f548107cbdcfb48cde70f67229a6148 parent 7fe22024b6eb88192e035d53c0be86afdaf7edcb Author: Sebastian <sebasjm@taler-systems.com> Date: Mon, 15 Dec 2025 11:38:41 -0300 missing strings in i18n system Diffstat:
9 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/packages/merchant-backoffice-ui/src/components/modal/index.tsx b/packages/merchant-backoffice-ui/src/components/modal/index.tsx @@ -41,10 +41,10 @@ const TALER_SCREEN_ID = 18; interface Props { active?: boolean; - description?: string; + description?: TranslatedString; onCancel?: () => void; confirm?: SafeHandlerTemplate<any, any>; - label?: string; + label: TranslatedString; children?: ComponentChildren; danger?: boolean; /** @@ -62,7 +62,7 @@ export function ConfirmModal({ confirm, children, danger, - label = "Confirm", + label, noCancelButton, }: Props): VNode { const { i18n } = useTranslationContext(); diff --git a/packages/merchant-backoffice-ui/src/paths/admin/list/View.tsx b/packages/merchant-backoffice-ui/src/paths/admin/list/View.tsx @@ -219,8 +219,8 @@ export function DeleteModal({ const { i18n } = useTranslationContext(); return ( <ConfirmModal - label={`Delete instance`} - description={`Delete the instance "${element.name}"`} + label={i18n.str`Delete instance`} + description={i18n.str`Delete the instance "${element.name}"`} danger active onCancel={onCancel} @@ -256,8 +256,8 @@ function PurgeModal({ element, onCancel, confirm }: DeleteModalProps): VNode { const { i18n } = useTranslationContext(); return ( <ConfirmModal - label={`Purge the instance`} - description={`Purge the instance "${element.name}"`} + label={i18n.str`Purge the instance`} + description={i18n.str`Purge the instance "${element.name}"`} danger active onCancel={onCancel} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accessTokens/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accessTokens/create/index.tsx @@ -50,6 +50,7 @@ export default function AccessTokenCreatePage({ active onCancel={onConfirm} description={i18n.str`Access token created`} + label={i18n.str`Confirm`} > <div class="table-container"> <table> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accessTokens/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accessTokens/list/index.tsx @@ -23,6 +23,7 @@ import { HttpStatusCode, TalerError, TokenInfo, + TranslatedString, assertUnreachable, } from "@gnu-taler/taler-util"; import { @@ -113,8 +114,8 @@ export default function AccessTokenListPage({ onCreate }: Props): VNode { /> {deleting && ( <ConfirmModal - label={`Delete access token`} - description={deleting.description} + label={i18n.str`Delete access token`} + description={deleting.description as TranslatedString} danger active onCancel={() => setDeleting(null)} 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 @@ -415,7 +415,8 @@ export function RefundModal({ //FIXME: parameters in the translation return ( <ConfirmModal - description="refund" + description={i18n.str`refund`} + label={i18n.str`Confirm`} danger active onCancel={onCancel} 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 @@ -26,9 +26,8 @@ import { TalerMerchantApi, } from "@gnu-taler/taler-util"; import { - useCommonPreferences, useLocalNotificationBetter, - useTranslationContext, + useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { ComponentChildren, Fragment, VNode, h } from "preact"; @@ -41,14 +40,14 @@ import { } from "../../../../components/form/FormProvider.js"; import { InputCurrency } from "../../../../components/form/InputCurrency.js"; import { InputNumber } from "../../../../components/form/InputNumber.js"; +import { FragmentPersonaFlag } from "../../../../components/menu/SideBar.js"; import { useSessionContext } from "../../../../context/session.js"; import { WithId } from "../../../../declaration.js"; import { - dateFormatForSettings, UIElement, + dateFormatForSettings, usePreference, } from "../../../../hooks/preference.js"; -import { FragmentPersonaFlag } from "../../../../components/menu/SideBar.js"; const TALER_SCREEN_ID = 56; diff --git a/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/products/list/index.tsx @@ -64,11 +64,11 @@ export default function ProductList({ onCreate, onSelect }: Props): VNode { !session.token || !deleting ? undefined : [session.token, deleting.id], ); remove.onSuccess = (suc, t, id) => { - setDeleting(null) - return i18n.str`Product (ID: ${id}) has been deleted` - } - remove.onFail = (fail) =>{ - switch(fail.case) { + setDeleting(null); + return i18n.str`Product (ID: ${id}) has been deleted`; + }; + remove.onFail = (fail) => { + switch (fail.case) { case HttpStatusCode.Unauthorized: return i18n.str`Unauthorized.`; case HttpStatusCode.NotFound: @@ -76,7 +76,7 @@ export default function ProductList({ onCreate, onSelect }: Props): VNode { case HttpStatusCode.Conflict: return i18n.str`Conflict.`; } - } + }; if (!result) return <Loading />; if (result instanceof TalerError) { return <ErrorLoadingMerchant error={result} />; @@ -118,8 +118,8 @@ export default function ProductList({ onCreate, onSelect }: Props): VNode { {deleting && ( <ConfirmModal - label={`Delete product`} - description={`Delete the product "${deleting.description}"`} + label={i18n.str`Delete product`} + description={i18n.str`Delete the product "${deleting.description}"`} danger active onCancel={() => setDeleting(null)} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/templates/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/templates/list/index.tsx @@ -135,8 +135,8 @@ export default function ListTemplates({ {deleting && ( <ConfirmModal - label={`Delete template`} - description={`Delete the template "${deleting.template_description}"`} + label={i18n.str`Delete template`} + description={i18n.str`Delete the template "${deleting.template_description}"`} danger active onCancel={() => setDeleting(null)} diff --git a/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/list/index.tsx @@ -107,8 +107,8 @@ export default function TokenFamilyList({ onCreate, onSelect }: Props): VNode { {deleting && ( <ConfirmModal - label={`Delete token family`} - description={`Delete the token family "${deleting.name}"`} + label={i18n.str`Delete token family`} + description={i18n.str`Delete the token family "${deleting.name}"`} danger active onCancel={() => setDeleting(null)}