Merge pull request #2017 from ONLYOFFICE/fix/bug-59179

bug 59179
This commit is contained in:
Julia Radzhabova 2022-10-19 16:54:32 +03:00 committed by GitHub
commit db9040247a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -893,6 +893,7 @@ define([
if (Common.UI.FeaturesManager.canChange('spellcheck') && this.mode.isEdit) { if (Common.UI.FeaturesManager.canChange('spellcheck') && this.mode.isEdit) {
var arrLang = SSE.getController('Spellcheck').loadLanguages(), var arrLang = SSE.getController('Spellcheck').loadLanguages(),
defaultShortName = "en-US",
allLangs = arrLang[0], allLangs = arrLang[0],
langs = arrLang[1], langs = arrLang[1],
change = arrLang[2]; change = arrLang[2];
@ -912,6 +913,8 @@ define([
item = this.cmbDictionaryLanguage.store.find(function (model) { item = this.cmbDictionaryLanguage.store.find(function (model) {
return model.get('shortName').indexOf(value) == 0; return model.get('shortName').indexOf(value) == 0;
}); });
if(!item)
item = this.cmbDictionaryLanguage.store.findWhere({shortName: defaultShortName})
} }
this.cmbDictionaryLanguage.setValue(item ? item.get('value') : langs[0].value); this.cmbDictionaryLanguage.setValue(item ? item.get('value') : langs[0].value);
value = this.cmbDictionaryLanguage.getValue(); value = this.cmbDictionaryLanguage.getValue();