diff --git a/editor/index.html b/editor/index.html index 7dc14f0936b57f..d40ae58eabb930 100644 --- a/editor/index.html +++ b/editor/index.html @@ -226,7 +226,7 @@ const file = hash.slice( 6 ); - if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) { + if ( confirm( editor.strings.getKey( 'prompt/file/open' ) ) ) { const loader = new THREE.FileLoader(); loader.crossOrigin = ''; diff --git a/editor/js/History.js b/editor/js/History.js index 519140e164a703..b0f69e71650c86 100644 --- a/editor/js/History.js +++ b/editor/js/History.js @@ -88,7 +88,7 @@ class History { if ( this.historyDisabled ) { - alert( 'Undo/Redo disabled while scene is playing.' ); + alert( this.editor.strings.getKey( 'prompt/history/forbid' ) ); return; } @@ -123,7 +123,7 @@ class History { if ( this.historyDisabled ) { - alert( 'Undo/Redo disabled while scene is playing.' ); + alert( this.editor.strings.getKey( 'prompt/history/forbid' ) ); return; } @@ -241,7 +241,7 @@ class History { if ( this.historyDisabled ) { - alert( 'Undo/Redo disabled while scene is playing.' ); + alert( this.editor.strings.getKey( 'prompt/history/forbid' ) ); return; } diff --git a/editor/js/Menubar.Examples.js b/editor/js/Menubar.Examples.js index f9a78429c74433..fc50f845b20982 100644 --- a/editor/js/Menubar.Examples.js +++ b/editor/js/Menubar.Examples.js @@ -41,7 +41,7 @@ function MenubarExamples( editor ) { option.setTextContent( strings.getKey( item.title ) ); option.onClick( function () { - if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) { + if ( confirm( strings.getKey( 'prompt/file/open' ) ) ) { loader.load( 'examples/' + item.file, function ( text ) { diff --git a/editor/js/Menubar.File.js b/editor/js/Menubar.File.js index 3416b468d31216..d136ca9ca596e8 100644 --- a/editor/js/Menubar.File.js +++ b/editor/js/Menubar.File.js @@ -26,7 +26,7 @@ function MenubarFile( editor ) { option.setTextContent( strings.getKey( 'menubar/file/new' ) ); option.onClick( function () { - if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) { + if ( confirm( strings.getKey( 'prompt/file/open' ) ) ) { editor.clear(); @@ -81,7 +81,7 @@ function MenubarFile( editor ) { if ( object === null || object.isMesh === undefined ) { - alert( 'No mesh selected' ); + alert( strings.getKey( 'prompt/file/export/noMeshSelected' ) ); return; } @@ -181,7 +181,7 @@ function MenubarFile( editor ) { if ( object === null ) { - alert( 'No object selected.' ); + alert( strings.getKey( 'prompt/file/export/noObjectSelected' ) ); return; } diff --git a/editor/js/Sidebar.Script.js b/editor/js/Sidebar.Script.js index a6945e9f0fb9d6..fc1b8fb6f8b5f1 100644 --- a/editor/js/Sidebar.Script.js +++ b/editor/js/Sidebar.Script.js @@ -81,7 +81,7 @@ function SidebarScript( editor ) { remove.setMarginLeft( '4px' ); remove.onClick( function () { - if ( confirm( 'Are you sure?' ) ) { + if ( confirm( strings.getKey( 'prompt/script/remove' ) ) ) { editor.execute( new RemoveScriptCommand( editor, editor.selected, script ) ); diff --git a/editor/js/Sidebar.Settings.History.js b/editor/js/Sidebar.Settings.History.js index 2dc43828f9cbe0..d7ad619f52c30a 100644 --- a/editor/js/Sidebar.Settings.History.js +++ b/editor/js/Sidebar.Settings.History.js @@ -25,7 +25,7 @@ function SidebarSettingsHistory( editor ) { if ( value ) { - alert( 'The history will be preserved across sessions.\nThis can have an impact on performance when working with textures.' ); + alert( strings.getKey( 'prompt/history/preserve' ) ); const lastUndoCmd = history.undos[ history.undos.length - 1 ]; const lastUndoId = ( lastUndoCmd !== undefined ) ? lastUndoCmd.id : 0; @@ -63,7 +63,7 @@ function SidebarSettingsHistory( editor ) { const option = new UIButton( strings.getKey( 'sidebar/history/clear' ) ); option.onClick( function () { - if ( confirm( 'The Undo/Redo History will be cleared. Are you sure?' ) ) { + if ( confirm( strings.getKey( 'prompt/history/clear' ) ) ) { editor.history.clear(); diff --git a/editor/js/Strings.js b/editor/js/Strings.js index 1c2ed6c7c4e30b..351219178663ac 100644 --- a/editor/js/Strings.js +++ b/editor/js/Strings.js @@ -6,6 +6,14 @@ function Strings( config ) { en: { + 'prompt/file/open': 'Any unsaved data will be lost. Are you sure?', + 'prompt/file/export/noMeshSelected': 'No Mesh selected!', + 'prompt/file/export/noObjectSelected': 'No Object selected!', + 'prompt/script/remove': 'Are you sure?', + 'prompt/history/clear': 'The Undo/Redo History will be cleared. Are you sure?', + '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.', + 'menubar/file': 'File', 'menubar/file/new': 'New', 'menubar/file/import': 'Import', @@ -362,6 +370,14 @@ function Strings( config ) { fr: { + 'prompt/file/open': 'Toutes les données non enregistrées seront perdues Êtes-vous sûr ?', + 'prompt/file/export/noMeshSelected': 'Aucun maillage sélectionné !', + 'prompt/file/export/noObjectSelected': 'Aucun objet sélectionné !', + 'prompt/script/remove': 'Es-tu sûr?', + 'prompt/history/clear': 'L\'historique d\'annulation/rétablissement sera effacé Êtes-vous sûr ?', + '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.', + 'menubar/file': 'Fichier', 'menubar/file/new': 'Nouveau', 'menubar/file/import': 'Importer', @@ -718,6 +734,14 @@ function Strings( config ) { zh: { + 'prompt/file/open': '您确定吗?未保存的数据将会丢失。', + 'prompt/file/export/noMeshSelected': '未选择网格!', + 'prompt/file/export/noObjectSelected': '未选择对象!', + 'prompt/script/remove': '你确定吗?', + 'prompt/history/clear': '撤销/重做历史记录将被清除。您确定吗?', + 'prompt/history/preserve': '历史将在会话之间保留。\n这可能会影响在处理纹理时的性能。', + 'prompt/history/forbid': '在播放场景时,撤消/重做被禁用。', + 'menubar/file': '文件', 'menubar/file/new': '新建', 'menubar/file/import': '导入', @@ -1074,6 +1098,14 @@ function Strings( config ) { ja: { + 'prompt/file/open': '保存されていないデータは失われます。 本気ですか?', + 'prompt/file/export/noMeshSelected': 'メッシュが選択されていません!', + 'prompt/file/export/noObjectSelected': 'オブジェクトが選択されていません!', + 'prompt/script/remove': '本気ですか?', + 'prompt/history/clear': '元に戻す/やり直しの履歴が消去されます。 本気ですか?', + 'prompt/history/preserve': '履歴はセッションをまたいで保存されます。\nこれは、テクスチャを操作する際のパフォーマンスに影響を与える可能性があります。', + 'prompt/history/forbid': 'シーンの再生中は元に戻す/やり直しは無効になります。', + 'menubar/file': 'ファイル', 'menubar/file/new': '新規', 'menubar/file/import': 'インポート',