From 2ea467a94cadcc942e8f96bfe7b7a78d3689d34d Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Tue, 24 Sep 2024 11:02:21 +0530 Subject: [PATCH] fix i18n for sort options --- src/Common/hooks/useFilters.tsx | 2 +- src/Components/Common/SortDropdown.tsx | 2 +- .../Facility/CentralNursingStation.tsx | 2 +- src/Locale/en/Common.json | 20 ++++++++++++-- src/Locale/en/SortOptions.json | 18 ------------- src/Locale/en/index.js | 2 -- src/Locale/hi/Common.json | 18 ++++++++++++- src/Locale/hi/SortOptions.json | 18 ------------- src/Locale/kn/Common.json | 18 ++++++++++++- src/Locale/kn/SortOptions.json | 18 ------------- src/Locale/kn/index.js | 26 +++++++++++++++++++ src/Locale/ml/Common.json | 18 ++++++++++++- src/Locale/ml/SortOptions.json | 18 ------------- src/Locale/ta/Common.json | 18 ++++++++++++- src/Locale/ta/SortOptions.json | 18 ------------- 15 files changed, 115 insertions(+), 101 deletions(-) delete mode 100644 src/Locale/en/SortOptions.json delete mode 100644 src/Locale/hi/SortOptions.json delete mode 100644 src/Locale/kn/SortOptions.json delete mode 100644 src/Locale/ml/SortOptions.json delete mode 100644 src/Locale/ta/SortOptions.json diff --git a/src/Common/hooks/useFilters.tsx b/src/Common/hooks/useFilters.tsx index a4b924edcdb..188dec2229d 100644 --- a/src/Common/hooks/useFilters.tsx +++ b/src/Common/hooks/useFilters.tsx @@ -109,7 +109,7 @@ export default function useFilters({ return { name, paramKey, - value: qParams[paramKey] && t("SortOptions." + qParams[paramKey]), + value: qParams[paramKey] && t("SORT_OPTIONS__" + qParams[paramKey]), }; }, value(name: string, paramKey: FilterBadgeProps["paramKey"], value: string) { diff --git a/src/Components/Common/SortDropdown.tsx b/src/Components/Common/SortDropdown.tsx index 8ffd09ba269..b54edffa595 100644 --- a/src/Components/Common/SortDropdown.tsx +++ b/src/Components/Common/SortDropdown.tsx @@ -41,7 +41,7 @@ export default function SortDropdownMenu(props: Props) { /> } > - {t("SortOptions." + value)} + {t("SORT_OPTIONS__" + value)} ))} diff --git a/src/Components/Facility/CentralNursingStation.tsx b/src/Components/Facility/CentralNursingStation.tsx index 178bd2bc25c..fbbdf24d7f2 100644 --- a/src/Components/Facility/CentralNursingStation.tsx +++ b/src/Components/Facility/CentralNursingStation.tsx @@ -145,7 +145,7 @@ export default function CentralNursingStation({ facilityId }: Props) { value={qParams.ordering || "bed__name"} onChange={({ value }) => updateQuery({ ordering: value })} options={SORT_OPTIONS} - optionLabel={({ value }) => t("SortOptions." + value)} + optionLabel={({ value }) => t("SORT_OPTIONS__" + value)} optionIcon={({ isAscending }) => (