feat(i18n): implement internationalization framework and update UI components for language support

This commit is contained in:
HouYunFei
2026-08-05 14:08:03 +08:00
parent 9bccd0ff1a
commit 0f6809251a
116 changed files with 3269 additions and 1870 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ import { create } from "zustand";
import { persist, type PersistStorage, type StorageValue } from "zustand/middleware";
import { nanoid } from "nanoid";
import i18n from "@/i18n";
import { localForageStorage } from "@/lib/localforage-storage";
import type { CanvasBackgroundMode } from "@/lib/canvas-theme";
import type { CanvasAssistantSession, CanvasConnection, CanvasNodeData, ViewportTransform } from "@/types/canvas";
@@ -64,7 +65,7 @@ export const useCanvasStore = create<CanvasStore>()(
(set, get) => ({
hydrated: false,
projects: [],
createProject: (title = "未命名画布") => {
createProject: (title = i18n.t("canvas.project.untitled")) => {
const now = new Date().toISOString();
const id = nanoid();
const project: CanvasProject = {
@@ -87,7 +88,7 @@ export const useCanvasStore = create<CanvasStore>()(
const now = new Date().toISOString();
const project: CanvasProject = {
id: nanoid(),
title: source.title || "导入画布",
title: source.title || i18n.t("canvas.project.imported"),
createdAt: source.createdAt || now,
updatedAt: now,
nodes: source.nodes || [],