Skip to content

Commit

Permalink
Add missing i18n translations - fixes ohcnetwork#10401
Browse files Browse the repository at this point in the history
  • Loading branch information
rajku-dev committed Feb 7, 2025
1 parent e4e67a5 commit da91b79
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from "@tanstack/react-query";
import { t } from "i18next";
import { useQueryParams } from "raviger";
import { useTranslation } from "react-i18next";
import { Trans, useTranslation } from "react-i18next";

import { cn } from "@/lib/utils";

Expand Down Expand Up @@ -214,19 +214,33 @@ function ResponseCard({ item }: { item: QuestionnaireResponse }) {
}
/>
) : (
<h3 className="text-sm font-medium">
{item.questionnaire?.title} {t("filed")}
</h3>
<Trans
i18nKey="filed"
values={{ title: item.questionnaire?.title }}
components={{ strong: <strong /> }}
/>
)}
</div>
<span>{t("at")}</span>
<span>{formatDateTime(item.created_date)}</span>
<span>{t("by")}</span>
<div>
{item.created_by?.first_name || ""}{" "}
{item.created_by?.last_name || ""}
{item.created_by?.user_type && ` (${item.created_by?.user_type})`}
</div>
<span>
<Trans
i18nKey="at"
values={{ time: formatDateTime(item.created_date) }}
components={{ strong: <strong /> }}
/>
</span>
<span>
<Trans
i18nKey="by"
values={{
by: `${item.created_by?.first_name || ""} ${item.created_by?.last_name || ""}${
item.created_by?.user_type
? ` (${item.created_by.user_type})`
: ""
}`,
}}
components={{ strong: <strong /> }}
/>
</span>
</div>
</div>
</div>
Expand Down
16 changes: 14 additions & 2 deletions src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,13 @@ const DiagnosisItem: React.FC<DiagnosisItemProps> = ({
disabled={disabled}
>
<SelectTrigger className="h-8 md:h-9">
<SelectValue placeholder={t("status_placeholder")} />
<SelectValue
placeholder={
<span className="text-gray-500">
{t("status_placeholder")}
</span>
}
/>
</SelectTrigger>
<SelectContent>
{DIAGNOSIS_CLINICAL_STATUS.map((status) => (
Expand Down Expand Up @@ -339,7 +345,13 @@ const DiagnosisItem: React.FC<DiagnosisItemProps> = ({
disabled={disabled}
>
<SelectTrigger className="h-8 md:h-9">
<SelectValue placeholder={t("verification_placeholder")} />
<SelectValue
placeholder={
<span className="text-gray-500">
{t("verification_placeholder")}
</span>
}
/>
</SelectTrigger>
<SelectContent>
{DIAGNOSIS_VERIFICATION_STATUS.map((status) => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Resource/PrintResourceLetter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function PrintResourceLetter({ id }: { id: string }) {

{/* From Address */}
<div className="mb-6">
<div className="font-semibold">{t("From")}:</div>
<div className="font-semibold">{t("from")}:</div>
<div className="mt-1">{data.origin_facility.name}</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Facility/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function FacilityOverview({ facilityId }: FacilityOverviewProps) {
href: `/facility/${facilityId}/users/${user?.username}/availability`,
},
{
title: t("Encounters"),
title: t("encounters"),
description: t("manage_facility_users"),
icon: Users,
href: `/facility/${facilityId}/encounters`,
Expand Down

0 comments on commit da91b79

Please sign in to comment.