From da91b79b712d47cf6f5f4c092c29670bdedd329e Mon Sep 17 00:00:00 2001 From: rajku-dev Date: Fri, 7 Feb 2025 07:32:31 +0530 Subject: [PATCH 1/8] Add missing i18n translations - fixes #10401 --- .../QuestionnaireResponsesList.tsx | 38 +++++++++++++------ .../QuestionTypes/DiagnosisQuestion.tsx | 16 +++++++- .../Resource/PrintResourceLetter.tsx | 2 +- src/pages/Facility/overview.tsx | 2 +- 4 files changed, 42 insertions(+), 16 deletions(-) diff --git a/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx b/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx index ea8ccfed412..c06b20c154a 100644 --- a/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx +++ b/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx @@ -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"; @@ -214,19 +214,33 @@ function ResponseCard({ item }: { item: QuestionnaireResponse }) { } /> ) : ( -

- {item.questionnaire?.title} {t("filed")} -

+ }} + /> )} - {t("at")} - {formatDateTime(item.created_date)} - {t("by")} -
- {item.created_by?.first_name || ""}{" "} - {item.created_by?.last_name || ""} - {item.created_by?.user_type && ` (${item.created_by?.user_type})`} -
+ + }} + /> + + + }} + /> + diff --git a/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx b/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx index f40485d97c0..4d3e97b4311 100644 --- a/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx @@ -309,7 +309,13 @@ const DiagnosisItem: React.FC = ({ disabled={disabled} > - + + {t("status_placeholder")} + + } + /> {DIAGNOSIS_CLINICAL_STATUS.map((status) => ( @@ -339,7 +345,13 @@ const DiagnosisItem: React.FC = ({ disabled={disabled} > - + + {t("verification_placeholder")} + + } + /> {DIAGNOSIS_VERIFICATION_STATUS.map((status) => ( diff --git a/src/components/Resource/PrintResourceLetter.tsx b/src/components/Resource/PrintResourceLetter.tsx index bc1a80f72a8..5fd6f82e209 100644 --- a/src/components/Resource/PrintResourceLetter.tsx +++ b/src/components/Resource/PrintResourceLetter.tsx @@ -45,7 +45,7 @@ export default function PrintResourceLetter({ id }: { id: string }) { {/* From Address */}
-
{t("From")}:
+
{t("from")}:
{data.origin_facility.name}
diff --git a/src/pages/Facility/overview.tsx b/src/pages/Facility/overview.tsx index 346a34c6c48..cf07db69e65 100644 --- a/src/pages/Facility/overview.tsx +++ b/src/pages/Facility/overview.tsx @@ -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`, From aaf80c0f0ee92dd5a0a746330f571d93380c48bd Mon Sep 17 00:00:00 2001 From: rajku-dev Date: Fri, 7 Feb 2025 07:33:51 +0530 Subject: [PATCH 2/8] add en.json --- public/locale/en.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/public/locale/en.json b/public/locale/en.json index 7a455f5a214..cf70e246308 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -478,7 +478,8 @@ "booked_by": "Booked by", "bradycardia": "Bradycardia", "breathlessness_level": "Breathlessness level", - "by": "By", + "by": "by {{by}}", + "filed": "filed {{title}}", "camera": "Camera", "camera_bed_link_success": "Camera linked to bed successfully.", "camera_permission_denied": "Camera Permission denied", @@ -2032,6 +2033,7 @@ "start_time_must_be_before_end_time": "Start time must be before end time", "state": "State", "state_reason_for_archiving": "State reason for archiving {{name}} file?", + "at": "at {{time}}", "status": "Status", "stop": "Stop", "stop_recording": "Stop Recording", @@ -2329,5 +2331,15 @@ "yet_to_be_decided": "Yet to be decided", "you_need_at_least_a_location_to_create_an_assest": "You need at least a location to create an assest.", "zoom_in": "Zoom In", - "zoom_out": "Zoom Out" + "zoom_out": "Zoom Out", + "status_placeholder": "Select diagnosis status ", + "verification_placeholder": "Select verification status", + "not_started": "Not started", + "end_date": "End date", + "external_id": "External ID", + "online": "Online", + "error_fetching_users_data": "Failed to load user data. Please try again later.", + "medication_already_marked_as_error": "Medication already marked as error", + "no_locations_available": "No locations available", + "organization_required": "Organization is required" } From 9e48f5c4cba92cf2bc5c62237e6aacea4752de28 Mon Sep 17 00:00:00 2001 From: rajku-dev Date: Fri, 7 Feb 2025 07:40:03 +0530 Subject: [PATCH 3/8] sort locales --- public/locale/en.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/public/locale/en.json b/public/locale/en.json index cf70e246308..287f971d3d3 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -410,6 +410,7 @@ "assigned_facility": "Facility assigned", "assigned_to": "Assigned to", "assigned_volunteer": "Assigned Volunteer", + "at": "at {{time}}", "atypical_presentation_details": "Atypical presentation details", "audio__allow_permission": "Please allow microphone permission in site settings", "audio__allow_permission_button": "Click here to know how to allow", @@ -479,7 +480,6 @@ "bradycardia": "Bradycardia", "breathlessness_level": "Breathlessness level", "by": "by {{by}}", - "filed": "filed {{title}}", "camera": "Camera", "camera_bed_link_success": "Camera linked to bed successfully.", "camera_permission_denied": "Camera Permission denied", @@ -914,6 +914,7 @@ "encounter_suggestion__R": "Consultation", "encounter_suggestion_edit_disallowed": "Not allowed to switch to this option in edit consultation", "encounters": "Encounters", + "end_date": "End date", "end_datetime": "End Date/Time", "end_dose": "End Dose", "end_time": "End Time", @@ -948,6 +949,7 @@ "error_fetching_slots_data": "Error while fetching slots data", "error_fetching_user_data": "Error while fetching user data", "error_fetching_user_details": "Error while fetching user details: ", + "error_fetching_users_data": "Failed to load user data. Please try again later.", "error_loading_questionnaire_response": "Error loading questionnaire response", "error_updating_encounter": "Error to Updating Encounter", "error_verifying_otp": "Error while verifying OTP, Please request a new OTP", @@ -969,6 +971,7 @@ "export": "Export", "export_live_patients": "Export Live Patients", "exporting": "Exporting", + "external_id": "External ID", "external_identifier": "External Identifier", "facilities": "Facilities", "facility": "Facility", @@ -1029,6 +1032,7 @@ "file_upload_error": "Error uploading file", "file_upload_success": "File uploaded successfully", "file_uploaded": "File Uploaded Successfully", + "filed": "filed {{title}}", "files": "Files", "fill_my_details": "Fill My Details", "filter": "Filter", @@ -1287,6 +1291,7 @@ "medical_worker": "Medical Worker", "medication": "Medication", "medication_administration_saved": "Medicine Administration saved", + "medication_already_marked_as_error": "Medication already marked as error", "medication_taken_between": "Medication Taken Between", "medicine": "Medicine", "medicine_administration": "Medicine Administration", @@ -1379,6 +1384,7 @@ "no_investigation": "No investigation Reports found", "no_investigation_suggestions": "No Investigation Suggestions", "no_linked_facilities": "No Linked Facilities", + "no_locations_available": "No locations available", "no_locations_found": "No locations found", "no_log_update_delta": "No changes since previous log update", "no_log_updates": "No log updates found", @@ -1437,6 +1443,7 @@ "not_eligible": "Not Eligible", "not_found": "Not Found", "not_specified": "Not Specified", + "not_started": "Not started", "not_taken": "Not Taken", "note": "Note", "notes": "Notes", @@ -1468,6 +1475,7 @@ "on_emergency_basis": " on emergency basis", "on_hold": "On Hold", "ongoing_medications": "Ongoing Medications", + "online": "Online", "only_indian_mobile_numbers_supported": "Currently only Indian numbers are supported", "onset": "Onset", "op_encounter": "OP Encounter", @@ -1484,6 +1492,7 @@ "organization_for_care_support": "Organization for Care Support", "organization_forbidden": "You don't have access to any organizations yet.", "organization_not_found": "No Organizations Found", + "organization_required": "Organization is required", "organizations": "Organizations", "organizations_fetch_error": "Error while fetching organizations", "origin_facility": "Current facility", @@ -2033,8 +2042,8 @@ "start_time_must_be_before_end_time": "Start time must be before end time", "state": "State", "state_reason_for_archiving": "State reason for archiving {{name}} file?", - "at": "at {{time}}", "status": "Status", + "status_placeholder": "Select diagnosis status ", "stop": "Stop", "stop_recording": "Stop Recording", "stopped": "Stopped", @@ -2260,6 +2269,7 @@ "ventilator_spo2": "SpO₂", "verification": "Verification", "verification_failed": "Verification Failed", + "verification_placeholder": "Select verification status", "verify": "Verify", "verify_and_link": "Verify and Link", "verify_otp": "Verify OTP", @@ -2331,15 +2341,5 @@ "yet_to_be_decided": "Yet to be decided", "you_need_at_least_a_location_to_create_an_assest": "You need at least a location to create an assest.", "zoom_in": "Zoom In", - "zoom_out": "Zoom Out", - "status_placeholder": "Select diagnosis status ", - "verification_placeholder": "Select verification status", - "not_started": "Not started", - "end_date": "End date", - "external_id": "External ID", - "online": "Online", - "error_fetching_users_data": "Failed to load user data. Please try again later.", - "medication_already_marked_as_error": "Medication already marked as error", - "no_locations_available": "No locations available", - "organization_required": "Organization is required" + "zoom_out": "Zoom Out" } From c81f74606bcd7561eda274f978fa3f102bf6a1c2 Mon Sep 17 00:00:00 2001 From: rajku-dev Date: Fri, 7 Feb 2025 07:42:21 +0530 Subject: [PATCH 4/8] rm spacing from definition --- public/locale/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locale/en.json b/public/locale/en.json index 287f971d3d3..665895c4aa2 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -2043,7 +2043,7 @@ "state": "State", "state_reason_for_archiving": "State reason for archiving {{name}} file?", "status": "Status", - "status_placeholder": "Select diagnosis status ", + "status_placeholder": "Select diagnosis status", "stop": "Stop", "stop_recording": "Stop Recording", "stopped": "Stopped", From 02a2cdc74962d7989c288c03738b08ef93d5887d Mon Sep 17 00:00:00 2001 From: rajku-dev Date: Sat, 8 Feb 2025 02:19:23 +0530 Subject: [PATCH 5/8] change key names --- public/locale/en.json | 6 +++--- .../ConsultationDetails/QuestionnaireResponsesList.tsx | 4 ++-- .../Questionnaire/QuestionTypes/DiagnosisQuestion.tsx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/locale/en.json b/public/locale/en.json index 665895c4aa2..75321d00e6c 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -410,7 +410,7 @@ "assigned_facility": "Facility assigned", "assigned_to": "Assigned to", "assigned_volunteer": "Assigned Volunteer", - "at": "at {{time}}", + "at_time": "at {{time}}", "atypical_presentation_details": "Atypical presentation details", "audio__allow_permission": "Please allow microphone permission in site settings", "audio__allow_permission_button": "Click here to know how to allow", @@ -479,7 +479,7 @@ "booked_by": "Booked by", "bradycardia": "Bradycardia", "breathlessness_level": "Breathlessness level", - "by": "by {{by}}", + "by_name": "by {{by}}", "camera": "Camera", "camera_bed_link_success": "Camera linked to bed successfully.", "camera_permission_denied": "Camera Permission denied", @@ -2043,7 +2043,7 @@ "state": "State", "state_reason_for_archiving": "State reason for archiving {{name}} file?", "status": "Status", - "status_placeholder": "Select diagnosis status", + "diagnosis_status_placeholder": "Select diagnosis status", "stop": "Stop", "stop_recording": "Stop Recording", "stopped": "Stopped", diff --git a/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx b/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx index c06b20c154a..47e040710e2 100644 --- a/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx +++ b/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx @@ -223,14 +223,14 @@ function ResponseCard({ item }: { item: QuestionnaireResponse }) { }} /> = ({ - {t("status_placeholder")} + {t("diagnosis_status_placeholder")} } /> From 9b08500a264b5efac42c45b7b309524b2259f47f Mon Sep 17 00:00:00 2001 From: rajku-dev Date: Sat, 8 Feb 2025 02:20:41 +0530 Subject: [PATCH 6/8] put husky on --- public/locale/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locale/en.json b/public/locale/en.json index 75321d00e6c..4ce7af4dc9f 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -713,6 +713,7 @@ "diagnosis_already_added": "This diagnosis was already added", "diagnosis_at_discharge": "Diagnosis at Discharge", "diagnosis_empty_message": "No diagnoses recorded", + "diagnosis_status_placeholder": "Select diagnosis status", "diastolic": "Diastolic", "didnt_receive_a_message": "Didn't receive a message?", "diet_preference": "Diet Preference", @@ -2043,7 +2044,6 @@ "state": "State", "state_reason_for_archiving": "State reason for archiving {{name}} file?", "status": "Status", - "diagnosis_status_placeholder": "Select diagnosis status", "stop": "Stop", "stop_recording": "Stop Recording", "stopped": "Stopped", From b97fe07a00f17b29935bca1f6f376b0c06496c8e Mon Sep 17 00:00:00 2001 From: rajku-dev Date: Sat, 8 Feb 2025 06:18:15 +0530 Subject: [PATCH 7/8] modify verification translation key --- public/locale/en.json | 2 +- .../Questionnaire/QuestionTypes/DiagnosisQuestion.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/locale/en.json b/public/locale/en.json index 4ce7af4dc9f..adc821e578a 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -714,6 +714,7 @@ "diagnosis_at_discharge": "Diagnosis at Discharge", "diagnosis_empty_message": "No diagnoses recorded", "diagnosis_status_placeholder": "Select diagnosis status", + "diagnosis_verification_placeholder": "Select verification status", "diastolic": "Diastolic", "didnt_receive_a_message": "Didn't receive a message?", "diet_preference": "Diet Preference", @@ -2269,7 +2270,6 @@ "ventilator_spo2": "SpO₂", "verification": "Verification", "verification_failed": "Verification Failed", - "verification_placeholder": "Select verification status", "verify": "Verify", "verify_and_link": "Verify and Link", "verify_otp": "Verify OTP", diff --git a/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx b/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx index 0fe7d86bb85..00379ae671a 100644 --- a/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx @@ -348,7 +348,7 @@ const DiagnosisItem: React.FC = ({ - {t("verification_placeholder")} + {t("diagnosis_verification_placeholder")} } /> From 8aecffcf001890b3c8f5daee8e06770736513c43 Mon Sep 17 00:00:00 2001 From: Raj kumar <150310085+rajku-dev@users.noreply.github.com> Date: Sat, 8 Feb 2025 09:43:22 +0530 Subject: [PATCH 8/8] Update public/locale/en.json Co-authored-by: Rithvik Nishad --- public/locale/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locale/en.json b/public/locale/en.json index adc821e578a..bda42ee7e7f 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -1293,7 +1293,7 @@ "medical_worker": "Medical Worker", "medication": "Medication", "medication_administration_saved": "Medicine Administration saved", - "medication_already_marked_as_error": "Medication already marked as error", + "medication_already_marked_as_error": "Medication already marked as entered in error", "medication_taken_between": "Medication Taken Between", "medicine": "Medicine", "medicine_administration": "Medicine Administration",