From d41b36d2e92ba530d7cba2ed50f35ebd771340ac Mon Sep 17 00:00:00 2001 From: liteng <930372551@qq.com> Date: Thu, 17 Jan 2019 20:30:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShadowEditor.Web/lang/zh-CN.js | 21 ++++++++++++++++++- ShadowEditor.Web/src/api/UIAPI.js | 2 +- .../src/command/AddObjectCommand.js | 2 +- .../src/command/AddScriptCommand.js | 2 +- .../src/command/MoveObjectCommand.js | 2 +- .../src/command/MultiCmdsCommand.js | 2 +- .../src/command/RemoveObjectCommand.js | 2 +- .../src/command/RemoveScriptCommand.js | 2 +- .../src/command/SetColorCommand.js | 2 +- .../src/command/SetGeometryCommand.js | 2 +- .../src/command/SetGeometryValueCommand.js | 2 +- .../src/command/SetMaterialColorCommand.js | 2 +- .../src/command/SetMaterialCommand.js | 2 +- .../src/command/SetMaterialMapCommand.js | 2 +- .../src/command/SetMaterialValueCommand.js | 2 +- .../src/command/SetPositionCommand.js | 2 +- .../src/command/SetRotationCommand.js | 2 +- .../src/command/SetScaleCommand.js | 2 +- .../src/command/SetSceneCommand.js | 2 +- .../src/command/SetScriptValueCommand.js | 2 +- .../src/command/SetUuidCommand.js | 2 +- .../src/command/SetValueCommand.js | 2 +- ShadowEditor.Web/src/language/Language.js | 20 +++++++++++++++++- 23 files changed, 60 insertions(+), 23 deletions(-) diff --git a/ShadowEditor.Web/lang/zh-CN.js b/ShadowEditor.Web/lang/zh-CN.js index abb755e1..a3cd960b 100644 --- a/ShadowEditor.Web/lang/zh-CN.js +++ b/ShadowEditor.Web/lang/zh-CN.js @@ -1,2 +1,21 @@ // api -ADD_MENU = '添加菜单'; \ No newline at end of file +L_ADD_MENU = '添加菜单'; + +// command +L_ADD_OBJECT_COLON = '添加物体:'; +L_ADD_SCRIPT = '添加脚本'; +L_MOVE_OBJECT = '移动物体'; +L_MULTI_MODIFY = '多种改变'; +L_REMOVE_OBJECT = '移除物体'; +L_REMOVE_SCRIPT = '移除脚本'; +L_SET = '设置'; +L_SET_GEOMETRY = '设置几何体'; +L_SET_GEOMETRY_DOT = '设置几何体.'; +L_SET_MATERIAL = '设置材质'; +L_NEW_MATERIAL = '新材质'; +L_SET_POSITION = '设置位置'; +L_SET_ROTATION = '设置旋转'; +L_SET_SCALE = '设置缩放'; +L_SET_SCENE = '设置场景'; +L_SET_SCRIPT = '设置脚本'; +L_UPDATE_UUID = '更新UUID'; diff --git a/ShadowEditor.Web/src/api/UIAPI.js b/ShadowEditor.Web/src/api/UIAPI.js index d8442277..435e5242 100644 --- a/ShadowEditor.Web/src/api/UIAPI.js +++ b/ShadowEditor.Web/src/api/UIAPI.js @@ -6,7 +6,7 @@ function UIAPI() { } UIAPI.prototype.addMenu = function () { - alert(ADD_MENU); + alert(L_ADD_MENU); }; export default UIAPI; \ No newline at end of file diff --git a/ShadowEditor.Web/src/command/AddObjectCommand.js b/ShadowEditor.Web/src/command/AddObjectCommand.js index 996aa81e..1278740a 100644 --- a/ShadowEditor.Web/src/command/AddObjectCommand.js +++ b/ShadowEditor.Web/src/command/AddObjectCommand.js @@ -15,7 +15,7 @@ function AddObjectCommand(object) { this.object = object; if (object !== undefined) { - this.name = '添加物体:' + object.name; + this.name = L_ADD_OBJECT_COLON + object.name; } }; diff --git a/ShadowEditor.Web/src/command/AddScriptCommand.js b/ShadowEditor.Web/src/command/AddScriptCommand.js index 53d2d88b..6b576f43 100644 --- a/ShadowEditor.Web/src/command/AddScriptCommand.js +++ b/ShadowEditor.Web/src/command/AddScriptCommand.js @@ -12,7 +12,7 @@ var AddScriptCommand = function (object, script) { Command.call(this); this.type = 'AddScriptCommand'; - this.name = '添加脚本'; + this.name = L_ADD_SCRIPT; this.object = object; this.script = script; diff --git a/ShadowEditor.Web/src/command/MoveObjectCommand.js b/ShadowEditor.Web/src/command/MoveObjectCommand.js index 8c5d4386..b934d615 100644 --- a/ShadowEditor.Web/src/command/MoveObjectCommand.js +++ b/ShadowEditor.Web/src/command/MoveObjectCommand.js @@ -13,7 +13,7 @@ function MoveObjectCommand(object, newParent, newBefore) { Command.call(this); this.type = 'MoveObjectCommand'; - this.name = '移动物体'; + this.name = L_MOVE_OBJECT; this.object = object; this.oldParent = (object !== undefined) ? object.parent : undefined; diff --git a/ShadowEditor.Web/src/command/MultiCmdsCommand.js b/ShadowEditor.Web/src/command/MultiCmdsCommand.js index 863caf5d..8266ef42 100644 --- a/ShadowEditor.Web/src/command/MultiCmdsCommand.js +++ b/ShadowEditor.Web/src/command/MultiCmdsCommand.js @@ -11,7 +11,7 @@ function MultiCmdsCommand(cmdArray) { Command.call(this); this.type = 'MultiCmdsCommand'; - this.name = '多种改变'; + this.name = L_MULTI_MODIFY; this.cmdArray = (cmdArray !== undefined) ? cmdArray : []; }; diff --git a/ShadowEditor.Web/src/command/RemoveObjectCommand.js b/ShadowEditor.Web/src/command/RemoveObjectCommand.js index 02204243..f907fbab 100644 --- a/ShadowEditor.Web/src/command/RemoveObjectCommand.js +++ b/ShadowEditor.Web/src/command/RemoveObjectCommand.js @@ -11,7 +11,7 @@ function RemoveObjectCommand(object) { Command.call(this); this.type = 'RemoveObjectCommand'; - this.name = '移除物体'; + this.name = L_REMOVE_OBJECT; this.object = object; diff --git a/ShadowEditor.Web/src/command/RemoveScriptCommand.js b/ShadowEditor.Web/src/command/RemoveScriptCommand.js index e23d917b..4c8a7c9d 100644 --- a/ShadowEditor.Web/src/command/RemoveScriptCommand.js +++ b/ShadowEditor.Web/src/command/RemoveScriptCommand.js @@ -12,7 +12,7 @@ function RemoveScriptCommand(object, script) { Command.call(this); this.type = 'RemoveScriptCommand'; - this.name = '移除脚本'; + this.name = L_REMOVE_SCRIPT; this.object = object; this.script = script; diff --git a/ShadowEditor.Web/src/command/SetColorCommand.js b/ShadowEditor.Web/src/command/SetColorCommand.js index b405f31d..ebf31c69 100644 --- a/ShadowEditor.Web/src/command/SetColorCommand.js +++ b/ShadowEditor.Web/src/command/SetColorCommand.js @@ -13,7 +13,7 @@ function SetColorCommand(object, attributeName, newValue) { Command.call(this); this.type = 'SetColorCommand'; - this.name = '设置 ' + attributeName; + this.name = L_SET + ' ' + attributeName; this.updatable = true; this.object = object; diff --git a/ShadowEditor.Web/src/command/SetGeometryCommand.js b/ShadowEditor.Web/src/command/SetGeometryCommand.js index e68779e1..23bd9494 100644 --- a/ShadowEditor.Web/src/command/SetGeometryCommand.js +++ b/ShadowEditor.Web/src/command/SetGeometryCommand.js @@ -12,7 +12,7 @@ function SetGeometryCommand(object, newGeometry) { Command.call(this); this.type = 'SetGeometryCommand'; - this.name = '设置几何体'; + this.name = L_SET_GEOMETRY; this.updatable = true; this.object = object; diff --git a/ShadowEditor.Web/src/command/SetGeometryValueCommand.js b/ShadowEditor.Web/src/command/SetGeometryValueCommand.js index c9b7f68f..c45d7676 100644 --- a/ShadowEditor.Web/src/command/SetGeometryValueCommand.js +++ b/ShadowEditor.Web/src/command/SetGeometryValueCommand.js @@ -13,7 +13,7 @@ function SetGeometryValueCommand(object, attributeName, newValue) { Command.call(this); this.type = 'SetGeometryValueCommand'; - this.name = '设置几何体.' + attributeName; + this.name = L_SET_GEOMETRY + '.' + attributeName; this.object = object; this.attributeName = attributeName; diff --git a/ShadowEditor.Web/src/command/SetMaterialColorCommand.js b/ShadowEditor.Web/src/command/SetMaterialColorCommand.js index ac25f775..269e6b36 100644 --- a/ShadowEditor.Web/src/command/SetMaterialColorCommand.js +++ b/ShadowEditor.Web/src/command/SetMaterialColorCommand.js @@ -13,7 +13,7 @@ function SetMaterialColorCommand(object, attributeName, newValue) { Command.call(this); this.type = 'SetMaterialColorCommand'; - this.name = '设置材质.' + attributeName; + this.name = L_SET_MATERIAL + '.' + attributeName; this.updatable = true; this.object = object; diff --git a/ShadowEditor.Web/src/command/SetMaterialCommand.js b/ShadowEditor.Web/src/command/SetMaterialCommand.js index 68505aee..8108a39d 100644 --- a/ShadowEditor.Web/src/command/SetMaterialCommand.js +++ b/ShadowEditor.Web/src/command/SetMaterialCommand.js @@ -12,7 +12,7 @@ function SetMaterialCommand(object, newMaterial) { Command.call(this); this.type = 'SetMaterialCommand'; - this.name = '新材质'; + this.name = L_NEW_MATERIAL; this.object = object; this.oldMaterial = (object !== undefined) ? object.material : undefined; diff --git a/ShadowEditor.Web/src/command/SetMaterialMapCommand.js b/ShadowEditor.Web/src/command/SetMaterialMapCommand.js index 9cb9f9fe..01b14953 100644 --- a/ShadowEditor.Web/src/command/SetMaterialMapCommand.js +++ b/ShadowEditor.Web/src/command/SetMaterialMapCommand.js @@ -13,7 +13,7 @@ function SetMaterialMapCommand(object, mapName, newMap) { Command.call(this); this.type = 'SetMaterialMapCommand'; - this.name = '设置材质.' + mapName; + this.name = L_SET_MATERIAL + '.' + mapName; this.object = object; this.mapName = mapName; diff --git a/ShadowEditor.Web/src/command/SetMaterialValueCommand.js b/ShadowEditor.Web/src/command/SetMaterialValueCommand.js index 37f8ae64..ba77559a 100644 --- a/ShadowEditor.Web/src/command/SetMaterialValueCommand.js +++ b/ShadowEditor.Web/src/command/SetMaterialValueCommand.js @@ -13,7 +13,7 @@ function SetMaterialValueCommand(object, attributeName, newValue) { Command.call(this); this.type = 'SetMaterialValueCommand'; - this.name = '设置材质.' + attributeName; + this.name = L_SET_MATERIAL + '.' + attributeName; this.updatable = true; this.object = object; diff --git a/ShadowEditor.Web/src/command/SetPositionCommand.js b/ShadowEditor.Web/src/command/SetPositionCommand.js index f548ef6e..4b71cc87 100644 --- a/ShadowEditor.Web/src/command/SetPositionCommand.js +++ b/ShadowEditor.Web/src/command/SetPositionCommand.js @@ -13,7 +13,7 @@ function SetPositionCommand(object, newPosition, optionalOldPosition) { Command.call(this); this.type = 'SetPositionCommand'; - this.name = '设置位置'; + this.name = L_SET_POSITION; this.updatable = true; this.object = object; diff --git a/ShadowEditor.Web/src/command/SetRotationCommand.js b/ShadowEditor.Web/src/command/SetRotationCommand.js index 3a796f07..62cd3b9f 100644 --- a/ShadowEditor.Web/src/command/SetRotationCommand.js +++ b/ShadowEditor.Web/src/command/SetRotationCommand.js @@ -13,7 +13,7 @@ function SetRotationCommand(object, newRotation, optionalOldRotation) { Command.call(this); this.type = 'SetRotationCommand'; - this.name = '设置旋转'; + this.name = L_SET_ROTATION; this.updatable = true; this.object = object; diff --git a/ShadowEditor.Web/src/command/SetScaleCommand.js b/ShadowEditor.Web/src/command/SetScaleCommand.js index c1db5a95..285acece 100644 --- a/ShadowEditor.Web/src/command/SetScaleCommand.js +++ b/ShadowEditor.Web/src/command/SetScaleCommand.js @@ -13,7 +13,7 @@ function SetScaleCommand(object, newScale, optionalOldScale) { Command.call(this); this.type = 'SetScaleCommand'; - this.name = '设置缩放'; + this.name = L_SET_SCALE; this.updatable = true; this.object = object; diff --git a/ShadowEditor.Web/src/command/SetSceneCommand.js b/ShadowEditor.Web/src/command/SetSceneCommand.js index ef40d543..8bfcd50d 100644 --- a/ShadowEditor.Web/src/command/SetSceneCommand.js +++ b/ShadowEditor.Web/src/command/SetSceneCommand.js @@ -14,7 +14,7 @@ function SetSceneCommand(scene) { Command.call(this); this.type = 'SetSceneCommand'; - this.name = '设置场景'; + this.name = L_SET_SCENE; this.cmdArray = []; diff --git a/ShadowEditor.Web/src/command/SetScriptValueCommand.js b/ShadowEditor.Web/src/command/SetScriptValueCommand.js index 185f2e64..c0f90858 100644 --- a/ShadowEditor.Web/src/command/SetScriptValueCommand.js +++ b/ShadowEditor.Web/src/command/SetScriptValueCommand.js @@ -16,7 +16,7 @@ function SetScriptValueCommand(object, script, attributeName, newValue, cursorPo Command.call(this); this.type = 'SetScriptValueCommand'; - this.name = '设置脚本.' + attributeName; + this.name = L_SET_SCRIPT + '.' + attributeName; this.updatable = true; this.object = object; diff --git a/ShadowEditor.Web/src/command/SetUuidCommand.js b/ShadowEditor.Web/src/command/SetUuidCommand.js index f3ef5e8a..6ed6c45d 100644 --- a/ShadowEditor.Web/src/command/SetUuidCommand.js +++ b/ShadowEditor.Web/src/command/SetUuidCommand.js @@ -12,7 +12,7 @@ function SetUuidCommand(object, newUuid) { Command.call(this); this.type = 'SetUuidCommand'; - this.name = '更新UUID'; + this.name = L_UPDATE_UUID; this.object = object; diff --git a/ShadowEditor.Web/src/command/SetValueCommand.js b/ShadowEditor.Web/src/command/SetValueCommand.js index d1b536f9..685e6edb 100644 --- a/ShadowEditor.Web/src/command/SetValueCommand.js +++ b/ShadowEditor.Web/src/command/SetValueCommand.js @@ -13,7 +13,7 @@ function SetValueCommand(object, attributeName, newValue) { Command.call(this); this.type = 'SetValueCommand'; - this.name = '设置' + attributeName; + this.name = L_SET + ' ' + attributeName; this.updatable = true; this.object = object; diff --git a/ShadowEditor.Web/src/language/Language.js b/ShadowEditor.Web/src/language/Language.js index 18938990..c5d8c463 100644 --- a/ShadowEditor.Web/src/language/Language.js +++ b/ShadowEditor.Web/src/language/Language.js @@ -1,4 +1,22 @@ Object.assign(window, { // api - ADD_MENU: 'Add Menu' + L_ADD_MENU: 'Add Menu', + + // command + L_ADD_OBJECT_COLON: 'Add Object:', + L_ADD_SCRIPT: 'Add Script', + L_MOVE_OBJECT: 'Move Object', + L_MULTI_MODIFY: 'Multi Modify', + L_REMOVE_OBJECT: 'Remove Object', + L_REMOVE_SCRIPT: 'Remove Script', + L_SET: 'Set', + L_SET_GEOMETRY: 'Set Geometry', + L_SET_MATERIAL: 'Set Material', + L_NEW_MATERIAL: 'New Material', + L_SET_POSITION: 'Set Position', + L_SET_ROTATION: 'Set Rotation', + L_SET_SCALE: 'Set Scale', + L_SET_SCENE: 'Set Scene', + L_SET_SCRIPT: 'Set Script', + L_UPDATE_UUID: 'Update UUID', }); \ No newline at end of file