diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 7bbd02381..00a89dd3e 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1951,6 +1951,7 @@ define([ (new DE.Views.WatermarkSettingsDialog({ props: me.api.asc_GetWatermarkProps(), api: me.api, + lang: me.mode.lang, fontStore: me.fontstore, handler: function(result, value) { if (result == 'ok') { diff --git a/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js b/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js index e4174cfc5..c4d7a4ca4 100644 --- a/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js +++ b/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js @@ -111,11 +111,14 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template', this.textControls = []; this.imageControls = []; this.fontName = 'Arial'; - this.lang = {value: 'en', displayValue: 'English'}; this.text = ''; this.isAutoColor = false; this.isImageLoaded = false; + var lang = options.lang || 'en', + val = Common.util.LanguageInfo.getLocalLanguageCode(lang); + this.lang = val ? {value: lang, displayValue: Common.util.LanguageInfo.getLocalLanguageName(val)[1], default: true} : {value: 'en', displayValue: 'English', default: true}; + Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); }, @@ -430,8 +433,11 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template', }); if (data.length) { me.cmbLang.setData(data); - me.cmbLang.setValue(me.lang.displayValue); - me.loadWMText(me.lang.value); + var res = me.loadWMText(me.lang.value); + if (res && me.lang.default) + me.cmbLang.setValue(res); + else + me.cmbLang.setValue(me.lang.displayValue); me.cmbLang.setDisabled(!me.radioText.getValue()); me.text && me.cmbText.setValue(me.text); } else @@ -477,6 +483,7 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template', this.cmbText.setData(data); this.cmbText.setValue(data[0].value); } + return item ? item.get('displayValue') : null; }, insertFromUrl: function() {