From 29ccd1e6d708930bcee032df2fd499b0654667d5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 22 Apr 2020 17:58:16 +0300 Subject: [PATCH] [SSE] Fix formula help --- .../main/app/controller/FormulaDialog.js | 2 -- apps/spreadsheeteditor/main/app/view/FormulaWizard.js | 10 ++++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js index 9e07a2f9e..b5d3ba0d4 100644 --- a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js @@ -226,9 +226,7 @@ define([ onSendFunctionWizardInfo: function(props) { if (props) { // show formula settings - console.log('show formula settings'); var me = this; - var name = props.asc_getName(), descrarr = this.getDescription(Common.Utils.InternalSettings.get("sse-settings-func-locale")), funcprops = { diff --git a/apps/spreadsheeteditor/main/app/view/FormulaWizard.js b/apps/spreadsheeteditor/main/app/view/FormulaWizard.js index f3169b11f..d2ecea731 100644 --- a/apps/spreadsheeteditor/main/app/view/FormulaWizard.js +++ b/apps/spreadsheeteditor/main/app/view/FormulaWizard.js @@ -328,19 +328,25 @@ define([ this.helpUrl = null; return; } + var lang = Common.Utils.InternalSettings.get("sse-settings-func-help"); + if (!lang) + lang = (this.lang) ? this.lang.split(/[\-\_]/)[0] : 'en'; + var me = this, - lang = (this.lang) ? this.lang.split(/[\-\_]/)[0] : 'en', name = '/Functions/' + this.funcprops.origin.toLocaleLowerCase().replace(/\./g, '-') + '.htm', url = 'resources/help/' + lang + name; fetch(url).then(function(response){ if ( response.ok ) { + Common.Utils.InternalSettings.set("sse-settings-func-help", lang); me.helpUrl = url; me.showHelp(); } else { - url = 'resources/help/en' + name; + lang = 'en'; + url = 'resources/help/' + lang + name; fetch(url).then(function(response){ if ( response.ok ) { + Common.Utils.InternalSettings.set("sse-settings-func-help", lang); me.helpUrl = url; me.showHelp(); } else {