Skip to content

Commit

Permalink
i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Aug 23, 2024
1 parent 217f2ca commit 5a50338
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 5 additions & 1 deletion src/Components/Common/FacilitySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import AutoCompleteAsync from "../Form/AutoCompleteAsync";
import { FacilityModel } from "../Facility/models";
import request from "../../Utils/request/request";
import routes from "../../Redux/api";
import { t } from "i18next";

interface FacilitySelectProps {
name: string;
Expand Down Expand Up @@ -69,7 +70,10 @@ export const FacilitySelect = (props: FacilitySelectProps) => {
});

if (allowNone)
return [{ name: "None", id: "NONE" }, ...(data?.results || [])];
return [
{ name: t("no_home_facility"), id: "NONE" },
...(data?.results || []),
];

return data?.results;
},
Expand Down
17 changes: 6 additions & 11 deletions src/Components/Users/ManageUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,7 @@ export default function ManageUsers() {
<div className="relative block h-full overflow-visible rounded-lg bg-white shadow hover:border-primary-500">
<div className="flex h-full flex-col justify-between @container">
<div className="px-6 py-4">
<div
className="flex flex-col
flex-wrap justify-between gap-3 @sm:flex-row"
>
<div className="flex flex-col flex-wrap justify-between gap-3 @sm:flex-row">
{user.username && (
<div
id="username"
Expand Down Expand Up @@ -264,8 +261,8 @@ export default function ManageUsers() {
<div
className={`flex ${
isExtremeSmallScreen
? " flex-wrap "
: " flex-col justify-between md:flex-row "
? "flex-wrap"
: "flex-col justify-between md:flex-row"
} gap-2 md:grid md:grid-cols-2`}
>
{user.user_type && (
Expand Down Expand Up @@ -340,9 +337,7 @@ export default function ManageUsers() {
)}
<div
className={`${
isExtremeSmallScreen
? "flex flex-wrap "
: "grid grid-cols-2 "
isExtremeSmallScreen ? "flex flex-wrap" : "grid grid-cols-2"
}`}
>
{user.created_by && (
Expand Down Expand Up @@ -563,7 +558,7 @@ export default function ManageUsers() {
"home_facility",
qParams.home_facility
? qParams.home_facility === "NONE"
? "None"
? t("no_home_facility")
: homeFacilityData?.name || ""
: "",
),
Expand Down Expand Up @@ -790,7 +785,7 @@ export function UserFacilities(props: { user: any }) {
<span>{user?.home_facility_object?.name}</span>
<span
className={
"flex items-center justify-center rounded-xl bg-green-600 px-2 py-0.5 text-sm font-medium text-white"
"flex items-center justify-center rounded-xl bg-green-600 px-2 py-0.5 text-sm font-medium text-white"
}
>
<CareIcon icon="l-estate" className="mr-1 pt-px text-lg" />
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Users/UserFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default function UserFilter(props: any) {
}
selected={
filterState.home_facility === "NONE"
? { name: "None", id: "NONE" }
? { name: t("no_home_facility"), id: "NONE" }
: filterState.home_facility_ref
}
errors=""
Expand Down
1 change: 1 addition & 0 deletions src/Locale/en/Users.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"add_new_user": "Add New User",
"no_users_found": "No Users Found",
"home_facility": "Home Facility",
"no_home_facility" : "No home facility assigned",
"clear_home_facility": "Clear Home Facility",
"linked_facilities": "Linked Facilities",
"no_linked_facilities": "No Linked Facilities",
Expand Down

0 comments on commit 5a50338

Please sign in to comment.