diff --git a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js index 7f6d0c07a7..d26ada4632 100644 --- a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js @@ -118,14 +118,14 @@ define([ return this; }, - setApi: function (api) { + setApi: function (api, loadTranslations) { this.api = api; if (this.formulasGroups) { Common.Utils.InternalSettings.set("sse-settings-func-last", Common.localStorage.getItem("sse-settings-func-last")); - this.reloadTranslations(Common.localStorage.getItem("sse-settings-func-locale") || this.appOptions.lang, true); + this.reloadTranslations(Common.localStorage.getItem("sse-settings-func-locale") || this.appOptions.lang, true, loadTranslations); - if (!this.mode.isEdit) return; + if (!this.mode.isEdit || loadTranslations) return; var me = this; @@ -176,7 +176,7 @@ define([ this.appOptions.lang = data.config.lang; }, - reloadTranslations: function (lang, suppressEvent) { + reloadTranslations: function (lang, suppressEvent, loadTranslations) { this.formulasLoaded = false; lang = (lang || 'en').toLowerCase(); @@ -206,7 +206,7 @@ define([ }); } - if (!this.mode.isEdit) return; + if (!this.mode.isEdit || loadTranslations) return; if (me.langDescJson[lang]) me.loadingFormulas(me.langDescJson[lang], suppressEvent); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 74131e3a65..845b40f553 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1125,9 +1125,7 @@ define([ me.onDocumentModifiedChanged(me.api.asc_isDocumentModified()); var formulasDlgController = application.getController('FormulaDialog'); - if (formulasDlgController) { - formulasDlgController.setMode(me.appOptions).setApi(me.api); - } + formulasDlgController && formulasDlgController.setApi(me.api); if (me.needToUpdateVersion) toolbarController.onApiCoAuthoringDisconnect(); @@ -1137,7 +1135,7 @@ define([ }, 50); } else { var formulasDlgController = application.getController('FormulaDialog'); - formulasDlgController && formulasDlgController.setMode(me.appOptions).setApi(me.api); + formulasDlgController && formulasDlgController.setApi(me.api); documentHolderView.createDelayedElementsViewer(); Common.Utils.injectSvgIcons(); Common.NotificationCenter.trigger('document:ready', 'main'); @@ -1655,6 +1653,9 @@ define([ var celleditorController = this.getApplication().getController('CellEditor'); celleditorController && celleditorController.setApi(this.api).setMode(this.appOptions); + + var formulasDlgController = this.getApplication().getController('FormulaDialog'); + formulasDlgController && formulasDlgController.setMode(this.appOptions).setApi(this.api, true); }, applyModeEditorElements: function(prevmode) {