diff --git a/internal/site/src/components/add-system.tsx b/internal/site/src/components/add-system.tsx index 9139dd94..6ef7a578 100644 --- a/internal/site/src/components/add-system.tsx +++ b/internal/site/src/components/add-system.tsx @@ -1,4 +1,4 @@ -import { t } from "@lingui/core/macro" +import { msg, t } from "@lingui/core/macro" import { Trans } from "@lingui/react/macro" import { useStore } from "@nanostores/react" import { getPagePath } from "@nanostores/router" @@ -36,31 +36,28 @@ import { AppleIcon, DockerIcon, FreeBsdIcon, TuxIcon, WindowsIcon } from "./ui/i import { InputCopy } from "./ui/input-copy" export function AddSystemButton({ className }: { className?: string }) { - if (isReadOnlyUser()) { - return null - } - const [open, setOpen] = useState(false) - const opened = useRef(false) - if (open) { - opened.current = true - } + if (isReadOnlyUser()) { + return null + } + const [open, setOpen] = useState(false) + const opened = useRef(false) + if (open) { + opened.current = true + } - return ( - - - - - {opened.current && } - - ) + return ( + + + + + {opened.current && } + + ) } /** @@ -127,6 +124,8 @@ export const SystemDialog = ({ setOpen, system }: { setOpen: (open: boolean) => } } + const systemTranslation = t`System` + return ( - {system ? `${t`Edit`} ${system?.name}` : Add New System} + {system ? ( + Edit {{ foo: systemTranslation }} + ) : ( + Add {{ foo: systemTranslation }} + )} Docker diff --git a/internal/site/src/components/routes/settings/quiet-hours.tsx b/internal/site/src/components/routes/settings/quiet-hours.tsx index 386a27fd..9dedaac0 100644 --- a/internal/site/src/components/routes/settings/quiet-hours.tsx +++ b/internal/site/src/components/routes/settings/quiet-hours.tsx @@ -24,7 +24,13 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog" -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" @@ -36,13 +42,14 @@ import { $systems } from "@/lib/stores" import { formatShortDate } from "@/lib/utils" import type { QuietHoursRecord, SystemRecord } from "@/types" +const quietHoursTranslation = t`Quiet Hours` + export function QuietHours() { const [data, setData] = useState([]) const [dialogOpen, setDialogOpen] = useState(false) const [editingRecord, setEditingRecord] = useState(null) const { toast } = useToast() const systems = useStore($systems) - useEffect(() => { let unsubscribe: (() => void) | undefined const pbOptions = { @@ -157,9 +164,7 @@ export function QuietHours() { <>
-

- Quiet hours -

+

{quietHoursTranslation}

Schedule quiet hours where notifications will not be sent, such as during maintenance periods. @@ -171,7 +176,7 @@ export function QuietHours() { @@ -249,6 +254,7 @@ export function QuietHours() { Edit + handleDelete(record.id)}> Delete @@ -382,9 +388,15 @@ function QuietHoursDialog({ return ( - {editingRecord ? Edit Quiet Hours : Add Quiet Hours} + + {editingRecord ? ( + Edit {{ foo: quietHoursTranslation }} + ) : ( + Add {{ foo: quietHoursTranslation }} + )} + - Configure quiet hours where notifications will not be sent. + Schedule quiet hours where notifications will not be sent.

@@ -405,7 +417,7 @@ function QuietHoursDialog({