diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 0664fe54..ed1938f6 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -1165,7 +1165,7 @@ class Editor extends EditorStartup { reject(new Error('URLLoadFail')); return; } - seAlert(this.uiStrings.notification.URLLoadFail + ': \n' + err); + seAlert(this.i18next.t('notification.URLLoadFail') + ': \n' + err); resolve(); }, complete() { diff --git a/src/editor/EditorStartup.js b/src/editor/EditorStartup.js index f74cd956..fa1b27de 100644 --- a/src/editor/EditorStartup.js +++ b/src/editor/EditorStartup.js @@ -216,7 +216,7 @@ class EditorStartup { let promptMoveLayerOnce = false; $id('selLayerNames').addEventListener('change', function(evt) { const destLayer = evt.currentTarget.options[evt.currentTarget.selectedIndex].value; - const confirmStr = self.uiStrings.notification.QmoveElemsToLayer.replace('%s', destLayer); + const confirmStr = self.i18next.t('notification.QmoveElemsToLayer').replace('%s', destLayer); /** * @param {boolean} ok * @returns {void} @@ -594,7 +594,7 @@ class EditorStartup { */ const editorObj = this; const importImage = function (e) { - document.getElementById('se-prompt-dialog').title = editorObj.uiStrings.notification.loadingImage; + document.getElementById('se-prompt-dialog').title = editorObj.i18next.t('notification.loadingImage'); e.stopPropagation(); e.preventDefault(); const file = (e.type === 'drop') ? e.dataTransfer.files[0] : this.files[0]; diff --git a/src/editor/MainMenu.js b/src/editor/MainMenu.js index e1402e76..856b4791 100644 --- a/src/editor/MainMenu.js +++ b/src/editor/MainMenu.js @@ -27,7 +27,7 @@ class MainMenu { */ async clickClear() { const [x, y] = this.editor.configObj.curConfig.dimensions; - const ok = await seConfirm(this.editor.uiStrings.notification.QwantToClear); + const ok = await seConfirm(this.editor.i18next.t('notification.QwantToClear')); if (ok === "Cancel") { return; } @@ -72,15 +72,15 @@ class MainMenu { this.editor.svgCanvas.setDocumentTitle(title); if (w !== "fit" && !isValidUnit("width", w)) { - seAlert(this.editor.uiStrings.notification.invalidAttrValGiven); + seAlert(this.editor.i18next.t('notification.invalidAttrValGiven')); return false; } if (h !== "fit" && !isValidUnit("height", h)) { - seAlert(this.editor.uiStrings.notification.invalidAttrValGiven); + seAlert(this.editor.i18next.t('notification.invalidAttrValGiven')); return false; } if (!this.editor.svgCanvas.setResolution(w, h)) { - seAlert(this.editor.uiStrings.notification.noContentToFitTo); + seAlert(this.editor.i18next.t('notification.noContentToFitTo')); return false; } // Set image save option diff --git a/src/editor/panels/LayersPanel.js b/src/editor/panels/LayersPanel.js index 810a178c..33ca3740 100644 --- a/src/editor/panels/LayersPanel.js +++ b/src/editor/panels/LayersPanel.js @@ -226,7 +226,7 @@ class LayersPanel { return; } if (this.editor.svgCanvas.getCurrentDrawing().hasLayer(newName)) { - alert(this.uiStrings.notification.dupeLayerName); + alert(this.i18next.t('notification.dupeLayerName')); return; } this.editor.svgCanvas.createLayer(newName); @@ -270,7 +270,7 @@ class LayersPanel { return; } if (this.editor.svgCanvas.getCurrentDrawing().hasLayer(newName)) { - alert(this.uiStrings.notification.dupeLayerName); + alert(this.i18next.t('notification.dupeLayerName')); return; } this.editor.svgCanvas.cloneLayer(newName); @@ -323,7 +323,7 @@ class LayersPanel { */ layerRename() { const oldName = document.querySelector("#layerlist tr.layersel td.layername").textContent; - const newName = prompt(this.uiStrings.notification.enterNewLayerName, ""); + const newName = prompt(this.i18next.t('notification.enterNewLayerName'), ""); if (!newName) { return; } diff --git a/src/editor/panels/TopPanel.js b/src/editor/panels/TopPanel.js index 1501b436..bdbfd5ef 100644 --- a/src/editor/panels/TopPanel.js +++ b/src/editor/panels/TopPanel.js @@ -138,7 +138,7 @@ class TopPanel { curhref = curhref.startsWith("data:") ? "" : curhref; // eslint-disable-next-line no-alert const url = prompt( - this.editor.uiStrings.notification.enterNewImgURL, + this.editor.i18next.t('notification.enterNewImgURL'), curhref ); if (url) {