From 299f271d180e88512b5eaaf60f2d58b4ae5e9b84 Mon Sep 17 00:00:00 2001 From: Agriya Dev5 Date: Wed, 19 May 2021 11:03:33 +0530 Subject: [PATCH] #98 i18next remove from window and add svgEditor --- src/editor/Editor.js | 1 + src/editor/EditorStartup.js | 1 - .../extensions/ext-storage/storageDialog.js | 18 +++++++++--------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 97838825..45c7168c 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -110,6 +110,7 @@ class Editor extends EditorStartup { this.topPanel = new TopPanel(this); this.layersPanel = new LayersPanel(this); this.mainMenu = new MainMenu(this); + window.svgEditor = this; } /** * diff --git a/src/editor/EditorStartup.js b/src/editor/EditorStartup.js index 446b8572..7042b873 100644 --- a/src/editor/EditorStartup.js +++ b/src/editor/EditorStartup.js @@ -68,7 +68,6 @@ class EditorStartup { const self = this; const { i18next } = await putLocale(this.configObj.pref('lang'), this.goodLangs); this.i18next = i18next; - window.i18next = i18next; // allow to prepare the dom without display this.$svgEditor.style.visibility = 'hidden'; try { diff --git a/src/editor/extensions/ext-storage/storageDialog.js b/src/editor/extensions/ext-storage/storageDialog.js index 680e93b0..1b72b085 100644 --- a/src/editor/extensions/ext-storage/storageDialog.js +++ b/src/editor/extensions/ext-storage/storageDialog.js @@ -1,15 +1,15 @@ /* eslint-disable max-len */ -/* globals i18next */ +/* globals svgEditor */ const template = document.createElement('template'); -const notification = i18next.t('notification.editorPreferencesMsg'); -const prefs_and_content = i18next.t('properties.prefs_and_content'); -const prefs_only = i18next.t('properties.prefs_only'); -const no_prefs_or_content = i18next.t('properties.no_prefs_or_content'); -const remember_this_choice = i18next.t('tools.remember_this_choice'); -const remember_this_choice_title = i18next.t('tools.remember_this_choice_title'); -const ok = i18next.t('common.ok'); -const cancel = i18next.t('common.cancel'); +const notification = svgEditor.i18next.t('notification.editorPreferencesMsg'); +const prefs_and_content = svgEditor.i18next.t('properties.prefs_and_content'); +const prefs_only = svgEditor.i18next.t('properties.prefs_only'); +const no_prefs_or_content = svgEditor.i18next.t('properties.no_prefs_or_content'); +const remember_this_choice = svgEditor.i18next.t('tools.remember_this_choice'); +const remember_this_choice_title = svgEditor.i18next.t('tools.remember_this_choice_title'); +const ok = svgEditor.i18next.t('common.ok'); +const cancel = svgEditor.i18next.t('common.cancel'); // eslint-disable-next-line no-unsanitized/property template.innerHTML = `