From 9fd59f52eded7c0f1cf22fc55f3e448336110aa6 Mon Sep 17 00:00:00 2001 From: mengstabketemaw Date: Tue, 30 Jun 2026 15:57:25 +0300 Subject: [PATCH] feat: add i18n support and localized labels to certification and profession features commit --- .../certification/pages/CertificationPage.tsx | 60 +-- .../configuration/pages/ConfigurationPage.tsx | 23 +- .../features/exam/pages/ExamDetailPage.tsx | 24 +- .../location/components/LocationDetail.tsx | 19 +- .../location/components/LocationForm.tsx | 9 +- .../location/components/LocationTypeModal.tsx | 28 +- .../features/location/pages/LocationPage.tsx | 5 +- .../features/question/pages/QuestionPage.tsx | 99 +++-- .../app/features/question/types/question.ts | 2 +- .../result/components/RecordResultModal.tsx | 6 +- .../app/features/result/pages/ResultPage.tsx | 374 ++++++++++-------- apps/backoffice/src/app/i18n/locales/am.ts | 90 +++++ apps/backoffice/src/app/i18n/locales/en.ts | 90 +++++ .../src/app/layouts/BackofficeLayout.tsx | 2 - .../location/components/LocationPicker.tsx | 16 +- .../profile/components/AddressFormContent.tsx | 79 ++-- .../pages/SeafarerRegistrationPage.tsx | 5 +- libs/ui/src/index.ts | 1 + .../ui/src/lib/input}/BilingualInput.tsx | 15 +- 19 files changed, 593 insertions(+), 354 deletions(-) rename {apps/portal/src/app/components => libs/ui/src/lib/input}/BilingualInput.tsx (77%) diff --git a/apps/backoffice/src/app/features/certification/pages/CertificationPage.tsx b/apps/backoffice/src/app/features/certification/pages/CertificationPage.tsx index 7f18fb7f6..d59296ad9 100644 --- a/apps/backoffice/src/app/features/certification/pages/CertificationPage.tsx +++ b/apps/backoffice/src/app/features/certification/pages/CertificationPage.tsx @@ -17,6 +17,7 @@ import { Alert, } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; +import { useTranslation } from 'react-i18next'; import { IconEdit, IconTrash, IconPlus, IconInfoCircle, IconCertificate } from '@tabler/icons-react'; import { notify } from '@ema-platform/ui'; import { @@ -38,6 +39,7 @@ function CertificationForm({ onSubmit: (values: { nameEn: string; nameAm: string; descEn: string; descAm: string }, isEdit: boolean) => void; onCancel: () => void; }) { + const { t } = useTranslation(); const [nameEn, setNameEn] = useState(editing?.name?.en ?? ''); const [nameAm, setNameAm] = useState(editing?.name?.am ?? ''); const [descEn, setDescEn] = useState(editing?.description?.en ?? ''); @@ -56,13 +58,13 @@ function CertificationForm({
- setNameEn(e.currentTarget.value)} size="sm" required /> - setNameAm(e.currentTarget.value)} size="sm" required /> -