refactor: support i18n

This commit is contained in:
mlogclub
2026-05-25 12:06:15 +08:00
parent 309ac1fe9e
commit 988f55c80d
179 changed files with 10968 additions and 3763 deletions
+4 -2
View File
@@ -15,6 +15,7 @@ import {
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { Maximize2Icon, Minimize2Icon, XIcon } from "lucide-react";
import { useI18n } from "@/i18n/provider";
const dialogSizeClassName = {
sm: "max-w-md sm:max-w-md",
@@ -61,6 +62,7 @@ function ProjectDialog({
defaultFullscreen = false,
bodyScrollable = true,
}: ProjectDialogProps) {
const t = useI18n();
const [fullscreen, setFullscreen] = useState(defaultFullscreen);
function handleOpenChange(nextOpen: boolean, eventDetails: unknown) {
@@ -129,7 +131,7 @@ function ProjectDialog({
>
{fullscreen ? <Minimize2Icon /> : <Maximize2Icon />}
<span className="sr-only">
{fullscreen ? "退出全屏" : "全屏显示"}
{fullscreen ? t("common.exitFullscreen") : t("common.fullscreen")}
</span>
</Button>
) : null}
@@ -138,7 +140,7 @@ function ProjectDialog({
render={<Button type="button" variant="ghost" size="icon-sm" />}
>
<XIcon />
<span className="sr-only"></span>
<span className="sr-only">{t("common.close")}</span>
</DialogClose>
) : null}
</div>