canvas语言适配

This commit is contained in:
X1627315083
2025-07-20 18:19:34 +08:00
parent 4b694236ee
commit c44aadc9e3
12 changed files with 207 additions and 64 deletions

View File

@@ -62,7 +62,8 @@ import { fabric } from "fabric-with-all";
import { getOriginObjectInfo } from "../utils/layerUtils";
import { restoreFabricObject } from "../utils/objectHelper";
import { UpdateGroupMaskPositionCommand } from "../commands/UpdateGroupMaskPositionCommand";
import { useI18n } from 'vue-i18n'
const {t} = useI18n()
/**
* 图层管理器 - 负责管理画布上的所有图层
* 包含图层的创建、删除、修改、排序等操作
@@ -579,7 +580,7 @@ export class LayerManager {
this.createFixedLayer();
// 创建一个空白图层(默认位于背景图层和固定图层之上)
await this.createLayer("图层 1");
await this.createLayer(t('Canvas.Layer1'));
} else {
// 检查是否已有背景层
const hasBackgroundLayer = this.layers.value.some((layer) => layer.isBackground);
@@ -601,7 +602,7 @@ export class LayerManager {
);
if (!hasNormalLayer) {
await this.createLayer("图层 1");
await this.createLayer(t('Canvas.Layer1'));
}
}