From 8f2dcb30f01f7e3d81ecd476647c5734d87aed41 Mon Sep 17 00:00:00 2001 From: estifanos Date: Wed, 12 Aug 2026 10:55:14 +0000 Subject: [PATCH] feat: add internationalization support for seafarer registry - Integrated i18n for seafarer registry page, including translations for various UI elements and statuses. - Updated SeafarerDetailDrawer and StatusModal components to utilize translation hooks. - Enhanced user feedback messages for status updates and errors. - Added new translations for Amharic and English locales, covering seafarer statuses, drawer labels, modal content, and table headers. localization for backoffice --- .../license-review/pages/LicenseQueuePage.tsx | 14 +- .../pages/MedicalVerificationPage.tsx | 136 ++++++++------ .../pages/PaymentConfigPage.tsx | 136 ++++++++++---- .../pages/SeafarerRegistryPage.tsx | 137 ++++++++------ apps/backoffice/src/app/i18n/locales/am.ts | 173 ++++++++++++++++++ apps/backoffice/src/app/i18n/locales/en.ts | 173 ++++++++++++++++++ 6 files changed, 620 insertions(+), 149 deletions(-) diff --git a/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx b/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx index a566e6a6e..6422e5297 100644 --- a/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx +++ b/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx @@ -38,6 +38,7 @@ import { STATUS_LABELS, applicantOrCompanyName, extractErrorMessage, + localized, useClaimApplicationMutation, useGetAllApplicationsQuery, useGetAssignedToMeQuery, @@ -409,7 +410,9 @@ export function LicenseQueuePage() { { header: t("queue.typeCol", "Type"), cell: ({ row }) => ( - {row.original.licenseType?.name?.en ?? "—"} + + {localized(row.original.licenseType?.name, i18n.language) || "—"} + ), }, { @@ -417,7 +420,10 @@ export function LicenseQueuePage() { label: t("queue.statusCol", "Status"), cell: ({ row }) => ( - {STATUS_LABELS[row.original.status]} + {t( + `queue.statusValues.${row.original.status}`, + STATUS_LABELS[row.original.status], + )} ), }, @@ -565,7 +571,7 @@ export function LicenseQueuePage() { placeholder={t("queue.anyStatus", "Any")} data={ALL_STATUSES.map((s) => ({ value: s, - label: STATUS_LABELS[s], + label: t(`queue.statusValues.${s}`, STATUS_LABELS[s]), }))} value={urlFilter.status ?? []} onChange={(v) => setFacet({ status: v as LicenseStatus[] })} @@ -578,7 +584,7 @@ export function LicenseQueuePage() { placeholder={t("queue.anyType", "Any")} data={(licenseTypes?.items ?? []).map((type) => ({ value: type.id, - label: type.name.en ?? type.key, + label: localized(type.name, i18n.language) || type.key, }))} value={urlFilter.licenseTypeId ?? null} onChange={(v) => setFacet({ licenseTypeId: v ?? undefined })} diff --git a/apps/backoffice/src/app/features/medical-verification/pages/MedicalVerificationPage.tsx b/apps/backoffice/src/app/features/medical-verification/pages/MedicalVerificationPage.tsx index d7b2b88de..c99ee9d38 100644 --- a/apps/backoffice/src/app/features/medical-verification/pages/MedicalVerificationPage.tsx +++ b/apps/backoffice/src/app/features/medical-verification/pages/MedicalVerificationPage.tsx @@ -1,4 +1,5 @@ import { useCallback, useMemo, useState } from 'react'; +import { useTranslation } from 'react-i18next'; import { Badge, Button, @@ -64,12 +65,13 @@ function RejectModal({ onConfirm: (remark: string) => void; loading: boolean; }) { + const { t } = useTranslation(); const [remark, setRemark] = useState(''); return (