From cb2060903233bd726c65837b1dc074719a5c9f5c Mon Sep 17 00:00:00 2001
From: Polawat Phetra
Date: Thu, 1 Feb 2024 11:48:44 +0700
Subject: [PATCH] ref #163 #168 #169 Add translation for "Finished", "Case"
status
---
components/case/caseStatus.tsx | 4 +++-
components/case/dayEvents.tsx | 4 +++-
components/report/dayEvents.tsx | 6 ++++--
i18n/translations.en.json | 1 +
i18n/translations.la.json | 5 +++--
5 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/components/case/caseStatus.tsx b/components/case/caseStatus.tsx
index 8b6b6d04..2068cb03 100644
--- a/components/case/caseStatus.tsx
+++ b/components/case/caseStatus.tsx
@@ -1,13 +1,15 @@
import React from "react";
+import { useTranslation } from "react-i18next";
type CaseStatusProps = {
statusLabel: string;
isFinished: boolean;
};
const CaseStatus: React.FC = ({ statusLabel, isFinished }) => {
+ const { t } = useTranslation();
return isFinished ? (
- Finished
+ {t("status.finished", "Finished")}
) : (
{statusLabel}
diff --git a/components/case/dayEvents.tsx b/components/case/dayEvents.tsx
index 73be9cc5..e113a3a2 100644
--- a/components/case/dayEvents.tsx
+++ b/components/case/dayEvents.tsx
@@ -2,9 +2,11 @@ import { CaseEvent } from "components/case/calendarViewModel";
import { DayEventsProps } from "components/widgets/calendar";
import { observer } from "mobx-react";
import { useRouter } from "next/router";
+import { useTranslation } from "react-i18next";
export const CaseDayEvents = observer(
({ date, viewModel }: DayEventsProps) => {
+ const { t } = useTranslation();
const router = useRouter();
const events = viewModel.getDayEvents(date);
return (
@@ -22,7 +24,7 @@ export const CaseDayEvents = observer(
font-normal rounded px-1
"
>
- finished
+ {t("status.finished", "finished")}
)}
diff --git a/components/report/dayEvents.tsx b/components/report/dayEvents.tsx
index f2abdb53..5e0ead0e 100644
--- a/components/report/dayEvents.tsx
+++ b/components/report/dayEvents.tsx
@@ -2,9 +2,11 @@ import { ReportEvent } from "components/report/calendarViewModel";
import { DayEventsProps } from "components/widgets/calendar";
import { observer } from "mobx-react";
import { useRouter } from "next/router";
+import { useTranslation } from "react-i18next";
export const ReportDayEvents = observer(
({ date, viewModel }: DayEventsProps) => {
+ const { t } = useTranslation();
const router = useRouter();
const events = viewModel.getDayEvents(date);
return (
@@ -26,7 +28,7 @@ export const ReportDayEvents = observer(
router.push(`/cases/${event.caseId}`);
}}
>
- case
+ {t("status.case", "case")}
)}
{event.testFlag && (
@@ -35,7 +37,7 @@ export const ReportDayEvents = observer(
font-normal rounded px-1
"
>
- Test
+ {t("status.test", "test")}
)}
diff --git a/i18n/translations.en.json b/i18n/translations.en.json
index 3823c364..0efd0db1 100644
--- a/i18n/translations.en.json
+++ b/i18n/translations.en.json
@@ -242,6 +242,7 @@
"case": "case",
"suspectedOutbreak": "suspected outbreak",
"outbreak": "outbreak",
+ "finished": "Finished",
"actions": {
"promoteToCase": "Promote to case",
"convertToTest": "Convert to test report"
diff --git a/i18n/translations.la.json b/i18n/translations.la.json
index 42db7113..f02ba01d 100644
--- a/i18n/translations.la.json
+++ b/i18n/translations.la.json
@@ -251,8 +251,9 @@
"status": {
"test": "ທົດສອບ",
"case": "ກໍລະນີ",
- "suspectedOutbreak": "suspected outbreak",
- "outbreak": "outbreak",
+ "suspectedOutbreak": "ສົງໃສການລະບາດ",
+ "outbreak": "ການລະບາດ",
+ "finished": "ສຳເລັດແລ້ວ",
"actions": {
"promoteToCase": "ປ່ຽນເປັນກໍລະນີ",
"convertToTest": "ປ່ຽນເປັນທົດສອບ"