diff --git a/src/editor/EditorStartup.js b/src/editor/EditorStartup.js index 367e3ec9..891f749a 100644 --- a/src/editor/EditorStartup.js +++ b/src/editor/EditorStartup.js @@ -61,6 +61,10 @@ class EditorStartup { * @returns {void} */ async init () { + if ('localStorage' in window) { // && onWeb removed so Webkit works locally + this.storage = window.localStorage; + } + this.configObj.load(); const self = this; const { i18next } = await putLocale(this.configObj.pref('lang'), this.goodLangs); this.i18next = i18next; @@ -97,12 +101,6 @@ class EditorStartup { console.error(err); } - if ('localStorage' in window) { // && onWeb removed so Webkit works locally - this.storage = window.localStorage; - } - - this.configObj.load(); - /** * @name module:SVGthis.canvas * @type {module:svgcanvas.SvgCanvas} diff --git a/src/editor/MainMenu.js b/src/editor/MainMenu.js index b07b0425..644bc216 100644 --- a/src/editor/MainMenu.js +++ b/src/editor/MainMenu.js @@ -111,11 +111,8 @@ class MainMenu { // set language if (lang && lang !== this.editor.configObj.pref("lang")) { - const { langParam, langData } = await this.editor.putLocale( - lang, - this.editor.goodLangs - ); - await this.editor.svgCanvassetLang(langParam, langData); + this.editor.configObj.pref("lang", lang); + seAlert('Changing the language needs reload'); } // set grid setting @@ -130,7 +127,7 @@ class MainMenu { this.editor.configObj.curConfig.baseUnit = baseunit; this.editor.svgCanvas.setConfig(this.editor.configObj.curConfig); this.editor.updateCanvas(); - this.editor.hidePreferences(); + this.hidePreferences(); } /**