Browse Source

Editor: Fixed non-localized history entries (#28275)

* localize commands

* adds space after colon

---------

Co-authored-by: Michael Herzog <[email protected]>
ycw 1 year ago
parent
commit
6990d5ff02

+ 1 - 1
editor/js/Sidebar.Material.js

@@ -500,7 +500,7 @@ function SidebarMaterial( editor ) {
 
 
 				}
 				}
 
 
-				editor.execute( new SetMaterialCommand( editor, currentObject, material, currentMaterialSlot ), 'New Material: ' + materialClass.getValue() );
+				editor.execute( new SetMaterialCommand( editor, currentObject, material, currentMaterialSlot ), strings.getKey( 'command/SetMaterial' ) + ': ' + materialClass.getValue() );
 				editor.addMaterial( material );
 				editor.addMaterial( material );
 				// TODO Copy other references in the scene graph
 				// TODO Copy other references in the scene graph
 				// keeping name and UUID then.
 				// keeping name and UUID then.

+ 92 - 0
editor/js/Strings.js

@@ -14,6 +14,29 @@ function Strings( config ) {
 			'prompt/history/preserve': 'The history will be preserved across sessions.\nThis can have an impact on performance when working with textures.',
 			'prompt/history/preserve': 'The history will be preserved across sessions.\nThis can have an impact on performance when working with textures.',
 			'prompt/history/forbid': 'Undo/Redo disabled while scene is playing.',
 			'prompt/history/forbid': 'Undo/Redo disabled while scene is playing.',
 
 
+			'command/AddObject': 'Add Object',
+			'command/AddScript': 'Add Script',
+			'command/MoveObject': 'Move Object',
+			'command/MultiCmds': 'Multiple Changes',
+			'command/RemoveObject': 'Remove Object',
+			'command/RemoveScript': 'Remove Script',
+			'command/SetColor': 'Set Color',
+			'command/SetGeometry': 'Set Geometry',
+			'command/SetGeometryValue': 'Set Geometry Value',
+			'command/SetMaterialColor': 'Set Material Color',
+			'command/SetMaterial': 'Set Material',
+			'command/SetMaterialMap': 'Set Material Map',
+			'command/SetMaterialRange': 'Set Material Range',
+			'command/SetMaterialValue': 'Set Material Value',
+			'command/SetMaterialVector': 'Set Material Vector',
+			'command/SetPosition': 'Set Position',
+			'command/SetRotation': 'Set Rotation',
+			'command/SetScale': 'Set Scale',
+			'command/SetScene': 'Set Scene',
+			'command/SetScriptValue': 'Set Script Value',
+			'command/SetUuid': 'Set UUID',
+			'command/SetValue': 'Set Value',
+
 			'menubar/file': 'File',
 			'menubar/file': 'File',
 			'menubar/file/new': 'New',
 			'menubar/file/new': 'New',
 			'menubar/file/import': 'Import',
 			'menubar/file/import': 'Import',
@@ -378,6 +401,29 @@ function Strings( config ) {
 			'prompt/history/preserve': 'L\'histoire sera conservée entre les sessions.\nCela peut avoir un impact sur les performances lors de la manipulation des textures.',
 			'prompt/history/preserve': 'L\'histoire sera conservée entre les sessions.\nCela peut avoir un impact sur les performances lors de la manipulation des textures.',
 			'prompt/history/forbid': 'Les fonctions Annuler/Rétablir sont désactivées pendant la lecture de la scène.',
 			'prompt/history/forbid': 'Les fonctions Annuler/Rétablir sont désactivées pendant la lecture de la scène.',
 
 
+			'command/AddObject': 'Ajouter un objet',
+			'command/AddScript': 'Ajouter un script',
+			'command/MoveObject': 'Déplacer l’objet',
+			'command/MultiCmds': 'Changements multiples',
+			'command/RemoveObject': 'Supprimer l’objet',
+			'command/RemoveScript': 'Supprimer le script',
+			'command/SetColor': 'Définir la couleur',
+			'command/SetGeometry': 'Définir la géométrie',
+			'command/SetGeometryValue': 'Définir la valeur de la géométrie',
+			'command/SetMaterialColor': 'Définir la couleur du matériau',
+			'command/SetMaterial': 'Matériel de l’ensemble',
+			'command/SetMaterialMap': 'Définir la carte des matériaux',
+			'command/SetMaterialRange': 'Définir la gamme de matériaux',
+			'command/SetMaterialValue': 'Définir la valeur du matériau',
+			'command/SetMaterialVector': 'Définir le vecteur de matériau',
+			'command/SetPosition': 'Définir la position',
+			'command/SetRotation': 'Définir la rotation',
+			'command/SetScale': 'Définir l’échelle',
+			'command/SetScene': 'Planter le décor',
+			'command/SetScriptValue': 'Définir la valeur du script',
+			'command/SetUuid': 'Définir l’UUID',
+			'command/SetValue': 'Définir la valeur',
+
 			'menubar/file': 'Fichier',
 			'menubar/file': 'Fichier',
 			'menubar/file/new': 'Nouveau',
 			'menubar/file/new': 'Nouveau',
 			'menubar/file/import': 'Importer',
 			'menubar/file/import': 'Importer',
@@ -742,6 +788,29 @@ function Strings( config ) {
 			'prompt/history/preserve': '历史将在会话之间保留。\n这可能会影响在处理纹理时的性能。',
 			'prompt/history/preserve': '历史将在会话之间保留。\n这可能会影响在处理纹理时的性能。',
 			'prompt/history/forbid': '在播放场景时,撤消/重做被禁用。',
 			'prompt/history/forbid': '在播放场景时,撤消/重做被禁用。',
 
 
+			'command/AddObject': '添加对象',
+			'command/AddScript': '添加脚本',
+			'command/MoveObject': '移动对象',
+			'command/MultiCmds': '多次更改',
+			'command/RemoveObject': '删除对象',
+			'command/RemoveScript': '删除脚本',
+			'command/SetColor': '设置颜色',
+			'command/SetGeometry': '设置几何图形',
+			'command/SetGeometryValue': '设置几何值',
+			'command/SetMaterialColor': '设置材质颜色',
+			'command/SetMaterial': '设置材质',
+			'command/SetMaterialMap': '设置材质贴图',
+			'command/SetMaterialRange': '设置材料范围',
+			'command/SetMaterialValue': '设置材料值',
+			'command/SetMaterialVector': '设置材质矢量',
+			'command/SetPosition': '设置位置',
+			'command/SetRotation': '设置旋转',
+			'command/SetScale': '设置比例',
+			'command/SetScene': '设置布景',
+			'command/SetScriptValue': '设置脚本值',
+			'command/SetUuid': '设置 UUID',
+			'command/SetValue': '设定值',
+
 			'menubar/file': '文件',
 			'menubar/file': '文件',
 			'menubar/file/new': '新建',
 			'menubar/file/new': '新建',
 			'menubar/file/import': '导入',
 			'menubar/file/import': '导入',
@@ -1106,6 +1175,29 @@ function Strings( config ) {
 			'prompt/history/preserve': '履歴はセッションをまたいで保存されます。\nこれは、テクスチャを操作する際のパフォーマンスに影響を与える可能性があります。',
 			'prompt/history/preserve': '履歴はセッションをまたいで保存されます。\nこれは、テクスチャを操作する際のパフォーマンスに影響を与える可能性があります。',
 			'prompt/history/forbid': 'シーンの再生中は元に戻す/やり直しは無効になります。',
 			'prompt/history/forbid': 'シーンの再生中は元に戻す/やり直しは無効になります。',
 
 
+			'command/AddObject': 'オブジェクトを追加',
+			'command/AddScript': 'スクリプトを追加',
+			'command/MoveObject': 'オブジェクトの移動',
+			'command/MultiCmds': '複数の変更',
+			'command/RemoveObject': 'オブジェクトを削除',
+			'command/RemoveScript': 'スクリプトの削除',
+			'command/SetColor': 'カラーを設定',
+			'command/SetGeometry': 'ジオメトリの設定',
+			'command/SetGeometryValue': 'ジオメトリ値の設定',
+			'command/SetMaterialColor': 'マテリアル カラーの設定',
+			'command/SetMaterial': 'マテリアルの設定',
+			'command/SetMaterialMap': 'マテリアル マップの設定',
+			'command/SetMaterialRange': 'マテリアル範囲の設定',
+			'command/SetMaterialValue': 'マテリアル値の設定',
+			'command/SetMaterialVector': '素材のベクトルを設定します',
+			'command/SetPosition': '位置を設定',
+			'command/SetRotation': '回転を設定',
+			'command/SetScale': 'スケールを設定',
+			'command/SetScene': 'セットシーン',
+			'command/SetScriptValue': 'スクリプト値の設定',
+			'command/SetUuid': 'UUIDの設定',
+			'command/SetValue': '値の設定',
+
 			'menubar/file': 'ファイル',
 			'menubar/file': 'ファイル',
 			'menubar/file/new': '新規',
 			'menubar/file/new': '新規',
 			'menubar/file/import': 'インポート',
 			'menubar/file/import': 'インポート',

+ 1 - 1
editor/js/commands/AddObjectCommand.js

@@ -17,7 +17,7 @@ class AddObjectCommand extends Command {
 		this.object = object;
 		this.object = object;
 		if ( object !== undefined ) {
 		if ( object !== undefined ) {
 
 
-			this.name = `Add Object: ${object.name}`;
+			this.name = editor.strings.getKey( 'command/AddObject' ) + ': ' + object.name;
 
 
 		}
 		}
 
 

+ 1 - 1
editor/js/commands/AddScriptCommand.js

@@ -13,7 +13,7 @@ class AddScriptCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'AddScriptCommand';
 		this.type = 'AddScriptCommand';
-		this.name = 'Add Script';
+		this.name = editor.strings.getKey( 'command/AddScript' );
 
 
 		this.object = object;
 		this.object = object;
 		this.script = script;
 		this.script = script;

+ 1 - 1
editor/js/commands/MoveObjectCommand.js

@@ -14,7 +14,7 @@ class MoveObjectCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'MoveObjectCommand';
 		this.type = 'MoveObjectCommand';
-		this.name = 'Move Object';
+		this.name = editor.strings.getKey( 'command/MoveObject' );
 
 
 		this.object = object;
 		this.object = object;
 		this.oldParent = ( object !== undefined ) ? object.parent : undefined;
 		this.oldParent = ( object !== undefined ) ? object.parent : undefined;

+ 1 - 1
editor/js/commands/MultiCmdsCommand.js

@@ -12,7 +12,7 @@ class MultiCmdsCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'MultiCmdsCommand';
 		this.type = 'MultiCmdsCommand';
-		this.name = 'Multiple Changes';
+		this.name = editor.strings.getKey( 'command/MultiCmds' );
 
 
 		this.cmdArray = ( cmdArray !== undefined ) ? cmdArray : [];
 		this.cmdArray = ( cmdArray !== undefined ) ? cmdArray : [];
 
 

+ 1 - 1
editor/js/commands/RemoveObjectCommand.js

@@ -14,7 +14,7 @@ class RemoveObjectCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'RemoveObjectCommand';
 		this.type = 'RemoveObjectCommand';
-		this.name = 'Remove Object';
+		this.name = editor.strings.getKey( 'command/RemoveObject' ) + ': ' + object.name;
 
 
 		this.object = object;
 		this.object = object;
 		this.parent = ( object !== undefined ) ? object.parent : undefined;
 		this.parent = ( object !== undefined ) ? object.parent : undefined;

+ 1 - 1
editor/js/commands/RemoveScriptCommand.js

@@ -13,7 +13,7 @@ class RemoveScriptCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'RemoveScriptCommand';
 		this.type = 'RemoveScriptCommand';
-		this.name = 'Remove Script';
+		this.name = editor.strings.getKey( 'command/RemoveScript' );
 
 
 		this.object = object;
 		this.object = object;
 		this.script = script;
 		this.script = script;

+ 1 - 1
editor/js/commands/SetColorCommand.js

@@ -14,7 +14,7 @@ class SetColorCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetColorCommand';
 		this.type = 'SetColorCommand';
-		this.name = `Set ${attributeName}`;
+		this.name = editor.strings.getKey( 'command/SetColor' ) + ': ' + attributeName;
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetGeometryCommand.js

@@ -15,7 +15,7 @@ class SetGeometryCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetGeometryCommand';
 		this.type = 'SetGeometryCommand';
-		this.name = 'Set Geometry';
+		this.name = editor.strings.getKey( 'command/SetGeometry' );
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetGeometryValueCommand.js

@@ -14,7 +14,7 @@ class SetGeometryValueCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetGeometryValueCommand';
 		this.type = 'SetGeometryValueCommand';
-		this.name = `Set Geometry.${attributeName}`;
+		this.name = editor.strings.getKey( 'command/SetGeometryValue' ) + ': ' + attributeName;
 
 
 		this.object = object;
 		this.object = object;
 		this.attributeName = attributeName;
 		this.attributeName = attributeName;

+ 1 - 1
editor/js/commands/SetMaterialColorCommand.js

@@ -14,7 +14,7 @@ class SetMaterialColorCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetMaterialColorCommand';
 		this.type = 'SetMaterialColorCommand';
-		this.name = `Set Material.${attributeName}`;
+		this.name = editor.strings.getKey( 'command/SetMaterialColor' ) + ': ' + attributeName;
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetMaterialCommand.js

@@ -14,7 +14,7 @@ class SetMaterialCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetMaterialCommand';
 		this.type = 'SetMaterialCommand';
-		this.name = 'New Material';
+		this.name = editor.strings.getKey( 'command/SetMaterial' );
 
 
 		this.object = object;
 		this.object = object;
 		this.materialSlot = materialSlot;
 		this.materialSlot = materialSlot;

+ 1 - 1
editor/js/commands/SetMaterialMapCommand.js

@@ -15,7 +15,7 @@ class SetMaterialMapCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetMaterialMapCommand';
 		this.type = 'SetMaterialMapCommand';
-		this.name = `Set Material.${mapName}`;
+		this.name = editor.strings.getKey( 'command/SetMaterialMap' ) + ': ' + mapName;
 
 
 		this.object = object;
 		this.object = object;
 		this.materialSlot = materialSlot;
 		this.materialSlot = materialSlot;

+ 1 - 1
editor/js/commands/SetMaterialRangeCommand.js

@@ -15,7 +15,7 @@ class SetMaterialRangeCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetMaterialRangeCommand';
 		this.type = 'SetMaterialRangeCommand';
-		this.name = `Set Material.${attributeName}`;
+		this.name = editor.strings.getKey( 'command/SetMaterialRange' ) + ': ' + attributeName;
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetMaterialValueCommand.js

@@ -14,7 +14,7 @@ class SetMaterialValueCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetMaterialValueCommand';
 		this.type = 'SetMaterialValueCommand';
-		this.name = `Set Material.${attributeName}`;
+		this.name = editor.strings.getKey( 'command/SetMaterialValue' ) + ': ' + attributeName;
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetMaterialVectorCommand.js

@@ -7,7 +7,7 @@ class SetMaterialVectorCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetMaterialVectorCommand';
 		this.type = 'SetMaterialVectorCommand';
-		this.name = `Set Material.${attributeName}`;
+		this.name = editor.strings.getKey( 'command/SetMaterialVector' ) + ': ' + attributeName;
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetPositionCommand.js

@@ -15,7 +15,7 @@ class SetPositionCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetPositionCommand';
 		this.type = 'SetPositionCommand';
-		this.name = 'Set Position';
+		this.name = editor.strings.getKey( 'command/SetPosition' );
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetRotationCommand.js

@@ -15,7 +15,7 @@ class SetRotationCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetRotationCommand';
 		this.type = 'SetRotationCommand';
-		this.name = 'Set Rotation';
+		this.name = editor.strings.getKey( 'command/SetRotation' );
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetScaleCommand.js

@@ -15,7 +15,7 @@ class SetScaleCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetScaleCommand';
 		this.type = 'SetScaleCommand';
-		this.name = 'Set Scale';
+		this.name = editor.strings.getKey( 'command/SetScale' );
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetSceneCommand.js

@@ -15,7 +15,7 @@ class SetSceneCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetSceneCommand';
 		this.type = 'SetSceneCommand';
-		this.name = 'Set Scene';
+		this.name = editor.strings.getKey( 'command/SetScene' );
 
 
 		this.cmdArray = [];
 		this.cmdArray = [];
 
 

+ 1 - 1
editor/js/commands/SetScriptValueCommand.js

@@ -15,7 +15,7 @@ class SetScriptValueCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetScriptValueCommand';
 		this.type = 'SetScriptValueCommand';
-		this.name = `Set Script.${attributeName}`;
+		this.name = editor.strings.getKey( 'command/SetScriptValue' ) + ': ' + attributeName;
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;

+ 1 - 1
editor/js/commands/SetUuidCommand.js

@@ -13,7 +13,7 @@ class SetUuidCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetUuidCommand';
 		this.type = 'SetUuidCommand';
-		this.name = 'Update UUID';
+		this.name = editor.strings.getKey( 'command/SetUuid' );
 
 
 		this.object = object;
 		this.object = object;
 
 

+ 1 - 1
editor/js/commands/SetValueCommand.js

@@ -14,7 +14,7 @@ class SetValueCommand extends Command {
 		super( editor );
 		super( editor );
 
 
 		this.type = 'SetValueCommand';
 		this.type = 'SetValueCommand';
-		this.name = `Set ${attributeName}`;
+		this.name = editor.strings.getKey( 'command/SetValue' ) + ': ' + attributeName;
 		this.updatable = true;
 		this.updatable = true;
 
 
 		this.object = object;
 		this.object = object;