Skip to content

Commit

Permalink
fixed all translation and removed duplicate ones
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 committed Oct 16, 2024
1 parent 827a682 commit 8e2412a
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 45 deletions.
69 changes: 37 additions & 32 deletions src/Components/Common/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
TooltipProvider,
TooltipTrigger,
} from "@/Components/ui/tooltip";
import { useTranslation } from "react-i18next";

export const SIDEBAR_SHRINK_PREFERENCE_KEY = "sidebarShrinkPreference";

Expand All @@ -38,19 +39,20 @@ const StatelessSidebar = ({
setShrinked,
onItemClick,
}: StatelessSidebarProps) => {
const { t } = useTranslation();
const NavItems: {
text: string;
to: string;
icon: IconName;
}[] = [
{ text: "Facilities", to: "/facility", icon: "l-hospital" },
{ text: "Patients", to: "/patients", icon: "l-user-injured" },
{ text: "Assets", to: "/assets", icon: "l-shopping-cart-alt" },
{ text: "Sample Test", to: "/sample", icon: "l-medkit" },
{ text: "Shifting", to: "/shifting", icon: "l-ambulance" },
{ text: "Resource", to: "/resource", icon: "l-heart-medical" },
{ text: "Users", to: "/users", icon: "l-users-alt" },
{ text: "Notice Board", to: "/notice_board", icon: "l-meeting-board" },
{ text: t("facilities"), to: "/facility", icon: "l-hospital" },
{ text: t("patients"), to: "/patients", icon: "l-user-injured" },
{ text: t("assets"), to: "/assets", icon: "l-shopping-cart-alt" },
{ text: t("sample_test"), to: "/sample", icon: "l-medkit" },
{ text: t("shifting"), to: "/shifting", icon: "l-ambulance" },
{ text: t("resource"), to: "/resource", icon: "l-heart-medical" },
{ text: t("users"), to: "/users", icon: "l-users-alt" },
{ text: t("notice_board"), to: "/notice_board", icon: "l-meeting-board" },
];

const activeLink = useActiveLink();
Expand Down Expand Up @@ -223,27 +225,30 @@ interface ToggleShrinkProps {
toggle: () => void;
}

const ToggleShrink = ({ shrinked, toggle }: ToggleShrinkProps) => (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<button
className={`flex h-6 w-6 cursor-pointer items-center justify-center rounded focus:outline-none focus:ring-2 focus:ring-indigo-500 ${shrinked ? "bg-gray-200" : "bg-gray-100"} text-gray-600 hover:bg-primary-200 hover:text-primary-800 ${
shrinked ? "mx-auto" : "mr-4"
} transition-all duration-200 ease-in-out`}
onClick={toggle}
>
<CareIcon
icon={shrinked ? "l-arrow-bar-right" : "l-layout-sidebar-alt"}
className={`text-lg ${
shrinked ? "" : ""
} transition-all delay-150 duration-300 ease-out`}
/>
</button>
</TooltipTrigger>
<TooltipContent>
<p>{shrinked ? "Expand Sidebar" : "Collapse Sidebar"}</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
);
const ToggleShrink = ({ shrinked, toggle }: ToggleShrinkProps) => {
const { t } = useTranslation();
return (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<button
className={`flex h-6 w-6 cursor-pointer items-center justify-center rounded focus:outline-none focus:ring-2 focus:ring-indigo-500 ${shrinked ? "bg-gray-200" : "bg-gray-100"} text-gray-600 hover:bg-primary-200 hover:text-primary-800 ${
shrinked ? "mx-auto" : "mr-4"
} transition-all duration-200 ease-in-out`}
onClick={toggle}
>
<CareIcon
icon={shrinked ? "l-arrow-bar-right" : "l-layout-sidebar-alt"}
className={`text-lg ${
shrinked ? "" : ""
} transition-all delay-150 duration-300 ease-out`}
/>
</button>
</TooltipTrigger>
<TooltipContent>
<p>{shrinked ? t("expand_sidebar") : t("collapse_sidebar")}</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
);
};
2 changes: 1 addition & 1 deletion src/Components/Facility/HospitalList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const HospitalList = () => {

return (
<Page
title={t("Facilities")}
title={t("facilities")}
breadcrumbs={false}
hideBack
options={
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Notifications/NoticeBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const NoticeBoard = () => {

if (loading) return <Loading />;
return (
<Page title={t("Notice Board")} hideBack={true} breadcrumbs={false}>
<Page title={t("notice_board")} hideBack={true} breadcrumbs={false}>
<div>{notices}</div>
</Page>
);
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ export const PatientManager = () => {

return (
<Page
title={t("Patients")}
title={t("patients")}
hideBack={true}
breadcrumbs={false}
options={
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Resource/ResourceBoardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function BoardView() {
<div className="flex w-full flex-col items-center justify-between lg:flex-row">
<div className="w-1/3 lg:w-1/4">
<PageTitle
title={t("Resource")}
title={t("resource")}
hideBack
className="mx-3 md:mx-5"
componentRight={
Expand Down
17 changes: 8 additions & 9 deletions src/Locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
"state": "State",
"location": "Location",
"ward": "Ward",
"Notice Board": "Notice Board",
"Assets": "Assets",
"notice_board": "Notice Board",
"assets": "Assets",
"Notifications": "Notifications",
"Submit": "Submit",
"Cancel": "Cancel",
Expand Down Expand Up @@ -395,12 +395,9 @@
"help_entered-in-error": "The statement was entered in error and is not valid.",
"search_icd11_placeholder": "Search for ICD-11 Diagnoses",
"icd11_as_recommended": "As per ICD-11 recommended by WHO",
"Facilities": "Facilities",
"Patients": "Patients",
"Sample Test": "Sample Test",
"Shifting": "Shifting",
"Resource": "Resource",
"Users": "Users",
"patients": "Patients",
"sample_test": "Sample Test",
"resource": "Resource",
"Profile": "Profile",
"Dashboard": "Dashboard",
"return_to_care": "Return to CARE",
Expand Down Expand Up @@ -1026,5 +1023,7 @@
"consultation_not_filed": "You have not filed any consultation for this patient yet.",
"consultation_not_filed_description": "Please file a consultation for this patient to continue.",
"width": "Width ({{unit}})",
"length": "Length ({{unit}})"
"length": "Length ({{unit}})",
"expand_sidebar": "Expand Sidebar",
"collapse_sidebar":"Collapse Sidebar"
}

0 comments on commit 8e2412a

Please sign in to comment.