Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions dashboard/src/components/theme-toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
import { useTranslation } from "react-i18next";

import { Button } from "@/components/ui/button";
import {
Expand All @@ -11,6 +12,7 @@ import {

export function ThemeToggle() {
const { theme, setTheme } = useTheme();
const { t } = useTranslation();

return (
<DropdownMenu>
Expand All @@ -21,13 +23,13 @@ export function ThemeToggle() {
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => setTheme("light")}>
Light
{t("theme.light")}
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("dark")}>
Dark
{t("theme.dark")}
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("system")}>
System
{t("theme.system")}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand Down
5 changes: 5 additions & 0 deletions dashboard/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,10 @@
"updatedAt": "Updated At",
"none": "None"
}
},
"theme": {
"light": "Light",
"dark": "Dark",
"system": "System"
}
}
5 changes: 5 additions & 0 deletions dashboard/src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,10 @@
"updatedAt": "更新时间",
"none": "无"
}
},
"theme": {
"light": "浅色",
"dark": "深色",
"system": "跟随系统"
}
}
Loading