Skip to content

Commit

Permalink
ref #163 #168 #169 Add translation for "Finished", "Case" status
Browse files Browse the repository at this point in the history
  • Loading branch information
pphetra committed Feb 1, 2024
1 parent 0a6e41f commit cb20609
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion components/case/caseStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React from "react";
import { useTranslation } from "react-i18next";

type CaseStatusProps = {
statusLabel: string;
isFinished: boolean;
};
const CaseStatus: React.FC<CaseStatusProps> = ({ statusLabel, isFinished }) => {
const { t } = useTranslation();
return isFinished ? (
<div className="bg-green-400 text-white text-center rounded cursor-pointer px-2">
Finished
{t("status.finished", "Finished")}
</div>
) : (
<div className="text-blue-400 text-center rounded px-2">{statusLabel}</div>
Expand Down
4 changes: 3 additions & 1 deletion components/case/dayEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<CaseEvent>) => {
const { t } = useTranslation();
const router = useRouter();
const events = viewModel.getDayEvents(date);
return (
Expand All @@ -22,7 +24,7 @@ export const CaseDayEvents = observer(
font-normal rounded px-1
"
>
finished
{t("status.finished", "finished")}
</span>
)}
</p>
Expand Down
6 changes: 4 additions & 2 deletions components/report/dayEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ReportEvent>) => {
const { t } = useTranslation();
const router = useRouter();
const events = viewModel.getDayEvents(date);
return (
Expand All @@ -26,7 +28,7 @@ export const ReportDayEvents = observer(
router.push(`/cases/${event.caseId}`);
}}
>
case
{t("status.case", "case")}
</span>
)}
{event.testFlag && (
Expand All @@ -35,7 +37,7 @@ export const ReportDayEvents = observer(
font-normal rounded px-1
"
>
Test
{t("status.test", "test")}
</span>
)}
</p>
Expand Down
1 change: 1 addition & 0 deletions i18n/translations.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
"case": "case",
"suspectedOutbreak": "suspected outbreak",
"outbreak": "outbreak",
"finished": "Finished",
"actions": {
"promoteToCase": "Promote to case",
"convertToTest": "Convert to test report"
Expand Down
5 changes: 3 additions & 2 deletions i18n/translations.la.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@
"status": {
"test": "ທົດສອບ",
"case": "ກໍລະນີ",
"suspectedOutbreak": "suspected outbreak",
"outbreak": "outbreak",
"suspectedOutbreak": "ສົງໃສການລະບາດ",
"outbreak": "ການລະບາດ",
"finished": "ສຳເລັດແລ້ວ",
"actions": {
"promoteToCase": "ປ່ຽນເປັນກໍລະນີ",
"convertToTest": "ປ່ຽນເປັນທົດສອບ"
Expand Down

0 comments on commit cb20609

Please sign in to comment.