aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx
index 315d78c63..e29c57a7c 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx
@@ -19,7 +19,8 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
-import { h, VNode, Fragment } from "preact";
+import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser";
+import { Fragment, h, VNode } from "preact";
import { useState } from "preact/hooks";
import { Loading } from "../../../../components/exception/loading.js";
import { NotificationCard } from "../../../../components/menu/index.js";
@@ -31,10 +32,9 @@ import {
useOrderAPI,
useOrderDetails,
} from "../../../../hooks/order.js";
-import { useTranslator } from "../../../../i18n/index.js";
import { Notification } from "../../../../utils/types.js";
-import { RefundModal } from "./Table.js";
import { ListPage } from "./ListPage.js";
+import { RefundModal } from "./Table.js";
interface Props {
onUnauthorized: () => VNode;
@@ -64,7 +64,7 @@ export default function OrderList({
const [notif, setNotif] = useState<Notification | undefined>(undefined);
- const i18n = useTranslator();
+ const { i18n } = useTranslationContext();
const [errorOrderId, setErrorOrderId] = useState<string | undefined>(
undefined,
);
@@ -86,7 +86,7 @@ export default function OrderList({
async function testIfOrderExistAndSelect(orderId: string): Promise<void> {
if (!orderId) {
- setErrorOrderId(i18n`Enter an order id`);
+ setErrorOrderId(i18n.str`Enter an order id`);
return;
}
try {
@@ -94,7 +94,7 @@ export default function OrderList({
onSelect(orderId);
setErrorOrderId(undefined);
} catch {
- setErrorOrderId(i18n`order not found`);
+ setErrorOrderId(i18n.str`order not found`);
}
}
@@ -136,13 +136,13 @@ export default function OrderList({
refundOrder(orderToBeRefunded.order_id, value)
.then(() =>
setNotif({
- message: i18n`refund created successfully`,
+ message: i18n.str`refund created successfully`,
type: "SUCCESS",
}),
)
.catch((error) =>
setNotif({
- message: i18n`could not create the refund`,
+ message: i18n.str`could not create the refund`,
type: "ERROR",
description: error.message,
}),
@@ -151,7 +151,7 @@ export default function OrderList({
}
onLoadError={(error) => {
setNotif({
- message: i18n`could not create the refund`,
+ message: i18n.str`could not create the refund`,
type: "ERROR",
description: error.message,
});
@@ -161,7 +161,7 @@ export default function OrderList({
onUnauthorized={onUnauthorized}
onNotFound={() => {
setNotif({
- message: i18n`could not get the order to refund`,
+ message: i18n.str`could not get the order to refund`,
type: "ERROR",
// description: error.message
});