[DE] Set interface language as default for watermark

This commit is contained in:
Julia Radzhabova 2019-09-16 14:46:03 +03:00
parent 92ad1e4d4e
commit 822968c6ad
2 changed files with 11 additions and 3 deletions

View file

@ -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') {

View file

@ -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() {