diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/admin/list/index.tsx')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/admin/list/index.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/admin/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/admin/list/index.tsx index 36d58dd41..9a81b72d4 100644 --- a/packages/merchant-backoffice-ui/src/paths/admin/list/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/admin/list/index.tsx @@ -19,6 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ +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"; @@ -27,7 +28,6 @@ import { DeleteModal, PurgeModal } from "../../../components/modal/index.js"; import { MerchantBackend } from "../../../declaration.js"; import { HttpError } from "../../../hooks/backend.js"; import { useAdminAPI, useBackendInstances } from "../../../hooks/instance.js"; -import { useTranslator } from "../../../i18n/index.js"; import { Notification } from "../../../utils/types.js"; import { View } from "./View.js"; @@ -56,7 +56,7 @@ export default function Instances({ useState<MerchantBackend.Instances.Instance | null>(null); const { deleteInstance, purgeInstance } = useAdminAPI(); const [notif, setNotif] = useState<Notification | undefined>(undefined); - const i18n = useTranslator(); + const { i18n } = useTranslationContext(); if (result.clientError && result.isUnauthorized) return onUnauthorized(); if (result.clientError && result.isNotfound) return onNotFound(); @@ -84,12 +84,12 @@ export default function Instances({ await deleteInstance(deleting.id); // pushNotification({ message: 'delete_success', type: 'SUCCESS' }) setNotif({ - message: i18n`Instance "${deleting.name}" (ID: ${deleting.id}) has been deleted`, + message: i18n.str`Instance "${deleting.name}" (ID: ${deleting.id}) has been deleted`, type: "SUCCESS", }); } catch (error) { setNotif({ - message: i18n`Failed to delete instance`, + message: i18n.str`Failed to delete instance`, type: "ERROR", description: error instanceof Error ? error.message : undefined, }); @@ -107,12 +107,12 @@ export default function Instances({ try { await purgeInstance(purging.id); setNotif({ - message: i18n`Instance "${purging.name}" (ID: ${purging.id}) has been disabled`, + message: i18n.str`Instance "${purging.name}" (ID: ${purging.id}) has been disabled`, type: "SUCCESS", }); } catch (error) { setNotif({ - message: i18n`Failed to purge instance`, + message: i18n.str`Failed to purge instance`, type: "ERROR", description: error instanceof Error ? error.message : undefined, }); |