部件选取多语言

This commit is contained in:
李志鹏
2026-01-26 17:07:06 +08:00
parent 44674b5396
commit 8ff7a31e92
4 changed files with 23 additions and 10 deletions

View File

@@ -20,13 +20,13 @@
<img <img
src="/src/assets/images/canvas/shubiao-l.png" src="/src/assets/images/canvas/shubiao-l.png"
/> />
<span>Left Click: Add</span> <span>{{ t("Canvas.LeftClickAdd") }}</span>
</div> </div>
<div> <div>
<img <img
src="/src/assets/images/canvas/shubiao-r.png" src="/src/assets/images/canvas/shubiao-r.png"
/> />
<span>Right Click: Remove</span> <span>{{ t("Canvas.RightClickRemove") }}</span>
</div> </div>
</div> </div>
</div> </div>
@@ -65,7 +65,7 @@
</div> --> </div> -->
<div class="action-btn" @click="onReset"> <div class="action-btn" @click="onReset">
<svg-icon name="CCut" size="26" /> <svg-icon name="CCut" size="26" />
<span class="btn-text">清空当前点位</span> <span class="btn-text">{{ $t("Canvas.TheClearlySelectedContent") }}</span>
</div> </div>
</div> </div>
</div> </div>
@@ -77,6 +77,8 @@
import { ref, onMounted, watch } from "vue"; import { ref, onMounted, watch } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { OperationType } from "../utils/layerHelper"; import { OperationType } from "../utils/layerHelper";
// 国际化
const { t } = useI18n();
const props = defineProps({ const props = defineProps({
canvas: { canvas: {
type: Object, type: Object,
@@ -121,32 +123,30 @@
const toolList = [ const toolList = [
{ {
type: OperationType.PART, type: OperationType.PART,
label: "Point Selection", label: t("Canvas.PointSelection"),
icon: "CPoint", icon: "CPoint",
size: "20", size: "20",
}, },
{ {
type: OperationType.PART_RECTANGLE, type: OperationType.PART_RECTANGLE,
label: "Marquee Selection", label: t("Canvas.MarqueeSelection"),
icon: "CMarquee", icon: "CMarquee",
size: "20", size: "20",
}, },
{ {
type: OperationType.PART_BRUSH, type: OperationType.PART_BRUSH,
label: "Brush Selection", label: t("Canvas.BrushSelection"),
icon: "CBrush2", icon: "CBrush2",
size: "16", size: "16",
}, },
{ {
type: OperationType.PART_ERASER, type: OperationType.PART_ERASER,
label: "Erase", label: t("Canvas.Erase"),
icon: "CEraser2", icon: "CEraser2",
size: "22", size: "22",
}, },
]; ];
// 国际化
const { t } = useI18n();
onMounted(() => {}); onMounted(() => {});

View File

@@ -108,6 +108,7 @@ export class PartManager {
} }
// 如果从选区工具切换到非选区工具,清理事件和选区 // 如果从选区工具切换到非选区工具,清理事件和选区
else if (wasActive && !this.isActive) { else if (wasActive && !this.isActive) {
this.selectionManager.clearSelection();
this.cleanupEvents(); this.cleanupEvents();
this.clearPartObject(); this.clearPartObject();
this.clearPointData(); this.clearPointData();
@@ -618,7 +619,7 @@ export class PartManager {
selectionManager: this.selectionManager, selectionManager: this.selectionManager,
toolManager: this.toolManager, toolManager: this.toolManager,
}) })
this.commandManager.execute(cmd); this.commandManager.execute(cmd)
} }
/** 清空点位 */ /** 清空点位 */
clearPart() { clearPart() {

View File

@@ -1503,6 +1503,12 @@ export default {
CompositeLuminosity: '亮度', CompositeLuminosity: '亮度',
CompositeLuminosityTip: '亮度:保留原图像颜色,改变新图像亮度', CompositeLuminosityTip: '亮度:保留原图像颜色,改变新图像亮度',
GarmentPartSelector: '服装部件选取', GarmentPartSelector: '服装部件选取',
LeftClickAdd: '左键添加',
RightClickRemove: '右键移除',
PointSelection: '点选',
MarqueeSelection: '框选',
BrushSelection: '画笔',
Erase: '擦除',
}, },
speedList: { speedList: {
High: '高级', High: '高级',

View File

@@ -1554,6 +1554,12 @@ export default {
CompositeLuminosityTip: CompositeLuminosityTip:
'Luminosity: Preserve the original image color and change the luminosity of the new image', 'Luminosity: Preserve the original image color and change the luminosity of the new image',
GarmentPartSelector: 'Garment Part Selector', GarmentPartSelector: 'Garment Part Selector',
LeftClickAdd: 'Left Click: Add',
RightClickRemove: 'Right Click: Remove',
PointSelection: 'Point Selection',
MarqueeSelection: 'Marquee Selection',
BrushSelection: 'Brush Selection',
Erase: 'Erase',
}, },
speedList: { speedList: {
High: 'High', High: 'High',