mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 06:51:23 +08:00
[PE DE SSE] Update language list in statusbar and context menu
This commit is contained in:
@ -90,8 +90,11 @@ define([], function () { 'use strict';
|
||||
'<% _.each(items, function(item) { %>',
|
||||
'<li id="<%= item.id %>" data-value="<%= item.value %>">',
|
||||
'<a tabindex="-1" type="menuitem" langval="<%= item.value %>">',
|
||||
'<i class="icon <% if (item.spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= scope.getDisplayValue(item) %>',
|
||||
'<div>',
|
||||
'<i class="icon <% if (item.spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= item.displayValue %>',
|
||||
'</div>',
|
||||
'<label style="opacity: 0.6"><%= item.displayValueEn %></label>',
|
||||
'</a>',
|
||||
'</li>',
|
||||
'<% }); %>',
|
||||
@ -101,6 +104,7 @@ define([], function () { 'use strict';
|
||||
data: this.options.languages,
|
||||
takeFocusOnClose: true,
|
||||
search: true,
|
||||
searchFields: ['displayValue', 'displayValueEn'],
|
||||
scrollAlwaysVisible: true
|
||||
});
|
||||
|
||||
@ -155,4 +159,4 @@ define([], function () { 'use strict';
|
||||
|
||||
labelSelect : 'Select document language'
|
||||
}, Common.Views.LanguageDialog || {}))
|
||||
});
|
||||
});
|
||||
|
||||
@ -2722,12 +2722,16 @@ define([
|
||||
for (var code in allLangs) {
|
||||
if (allLangs.hasOwnProperty(code)) {
|
||||
info = allLangs[code];
|
||||
info[2] && langs.push({
|
||||
displayValue: info[1],
|
||||
value: info[0],
|
||||
code: parseInt(code),
|
||||
spellcheck: _.indexOf(apiLangs, code)>-1
|
||||
});
|
||||
if(info[2]) {
|
||||
var displayName = Common.util.LanguageInfo.getLocalLanguageDisplayName(code);
|
||||
langs.push({
|
||||
displayValue: displayName.native,
|
||||
displayValueEn: displayName.english,
|
||||
value: info[0],
|
||||
code: parseInt(code),
|
||||
spellcheck: _.indexOf(apiLangs, code)>-1
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -256,10 +256,11 @@ define([
|
||||
|
||||
_onTextLanguage: function(langId) {
|
||||
var info = Common.util.LanguageInfo.getLocalLanguageName(langId);
|
||||
var displayName = Common.util.LanguageInfo.getLocalLanguageDisplayName(langId);
|
||||
this.statusbar.setLanguage({
|
||||
value: info[0],
|
||||
displayValue: info[1],
|
||||
code: langId
|
||||
value: info[0],
|
||||
displayValue: (displayName ? displayName.native : ''),
|
||||
code: langId
|
||||
});
|
||||
},
|
||||
|
||||
@ -372,4 +373,4 @@ define([
|
||||
textSetTrackChanges: 'You are in Track Changes mode',
|
||||
textDisconnect: '<b>Connection is lost</b><br>Trying to connect. Please check connection settings.'
|
||||
}, DE.Controllers.Statusbar || {}));
|
||||
});
|
||||
});
|
||||
|
||||
@ -201,6 +201,7 @@ define([
|
||||
_.each(langs, function(lang) {
|
||||
var item = {
|
||||
caption : lang.displayValue,
|
||||
captionEn : lang.displayValueEn,
|
||||
value : lang.value,
|
||||
checkable : true,
|
||||
langid : lang.code,
|
||||
@ -327,4 +328,4 @@ define([
|
||||
parseIcons: function() {}
|
||||
|
||||
}, DE.Views.DocumentHolder || {}));
|
||||
});
|
||||
});
|
||||
|
||||
@ -758,9 +758,12 @@ define([], function () {
|
||||
});
|
||||
|
||||
var langTemplate = _.template([
|
||||
'<a id="<%= id %>" tabindex="-1" type="menuitem" langval="<%= value %>" class="<% if (checked) { %> checked <% } %>">',
|
||||
'<i class="icon <% if (spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= caption %>',
|
||||
'<a id="<%= id %>" tabindex="-1" type="menuitem" langval="<%= value.value %>" class="<% if (checked) { %> checked <% } %>">',
|
||||
'<div>',
|
||||
'<i class="icon <% if (spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= caption %>',
|
||||
'</div>',
|
||||
'<label style="opacity: 0.6"><%= captionEn %></label>',
|
||||
'</a>'
|
||||
].join(''));
|
||||
|
||||
@ -774,6 +777,7 @@ define([], function () {
|
||||
items : [],
|
||||
itemTemplate: langTemplate,
|
||||
search: true,
|
||||
searchFields: ['caption', 'captionEn'],
|
||||
focusToCheckedItem: true
|
||||
})
|
||||
});
|
||||
@ -1506,6 +1510,7 @@ define([], function () {
|
||||
items : [],
|
||||
itemTemplate: langTemplate,
|
||||
search: true,
|
||||
searchFields: ['caption', 'captionEn'],
|
||||
focusToCheckedItem: true
|
||||
})
|
||||
});
|
||||
@ -2241,4 +2246,4 @@ define([], function () {
|
||||
};
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@ -230,7 +230,7 @@ define([
|
||||
this.btnLanguage = new Common.UI.Button({
|
||||
cls : 'btn-toolbar',
|
||||
scaling : false,
|
||||
caption : 'English (United States)',
|
||||
caption : 'English – United States',
|
||||
hintAnchor : 'top-left',
|
||||
disabled: true,
|
||||
dataHint : '0',
|
||||
@ -244,12 +244,16 @@ define([
|
||||
restoreHeight: 285,
|
||||
itemTemplate: _.template([
|
||||
'<a id="<%= id %>" tabindex="-1" type="menuitem" langval="<%= value.value %>" class="<% if (checked) { %> checked <% } %>">',
|
||||
'<i class="icon <% if (spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= caption %>',
|
||||
'<div>',
|
||||
'<i class="icon <% if (spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= caption %>',
|
||||
'</div>',
|
||||
'<label style="opacity: 0.6"><%= captionEn %></label>',
|
||||
'</a>'
|
||||
].join('')),
|
||||
menuAlign: 'bl-tl',
|
||||
search: true,
|
||||
searchFields: ['caption', 'captionEn'],
|
||||
focusToCheckedItem: true
|
||||
});
|
||||
|
||||
@ -401,6 +405,7 @@ define([
|
||||
_.each(array, function(item) {
|
||||
arr.push({
|
||||
caption : item['displayValue'],
|
||||
captionEn : item['displayValueEn'],
|
||||
value : {value: item['value'], code: item['code']},
|
||||
checkable : true,
|
||||
checked : saved == item['displayValue'],
|
||||
@ -529,4 +534,4 @@ define([
|
||||
txtSpaces: 'Symbols with spaces'
|
||||
}, DE.Views.Statusbar || {}));
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@ -2289,12 +2289,16 @@ define([
|
||||
for (var code in allLangs) {
|
||||
if (allLangs.hasOwnProperty(code)) {
|
||||
info = allLangs[code];
|
||||
info[2] && langs.push({
|
||||
displayValue: info[1],
|
||||
value: info[0],
|
||||
code: parseInt(code),
|
||||
spellcheck: _.indexOf(apiLangs, code)>-1
|
||||
});
|
||||
if(info[2]) {
|
||||
var displayName = Common.util.LanguageInfo.getLocalLanguageDisplayName(code);
|
||||
langs.push({
|
||||
displayValue: displayName.native,
|
||||
displayValueEn: displayName.english,
|
||||
value: info[0],
|
||||
code: parseInt(code),
|
||||
spellcheck: _.indexOf(apiLangs, code)>-1
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -194,9 +194,10 @@ define([
|
||||
|
||||
_onTextLanguage: function(langId) {
|
||||
var info = Common.util.LanguageInfo.getLocalLanguageName(langId);
|
||||
var displayName = Common.util.LanguageInfo.getLocalLanguageDisplayName(langId);
|
||||
this.statusbar.setLanguage({
|
||||
value: info[0],
|
||||
displayValue: info[1],
|
||||
displayValue: (displayName ? displayName.native : ''),
|
||||
code: langId
|
||||
});
|
||||
},
|
||||
@ -278,4 +279,4 @@ define([
|
||||
textDisconnect: '<b>Connection is lost</b><br>Trying to connect. Please check connection settings.'
|
||||
|
||||
}, PE.Controllers.Statusbar || {}));
|
||||
});
|
||||
});
|
||||
|
||||
@ -230,6 +230,7 @@ define([
|
||||
_.each(langs, function(lang) {
|
||||
var item = {
|
||||
caption : lang.displayValue,
|
||||
captionEn : lang.displayValueEn,
|
||||
value : lang.value,
|
||||
checkable : true,
|
||||
langid : lang.code,
|
||||
@ -322,4 +323,4 @@ define([
|
||||
parseIcons: function() {}
|
||||
|
||||
}, PE.Views.DocumentHolder || {}));
|
||||
});
|
||||
});
|
||||
|
||||
@ -668,9 +668,12 @@ define([], function () {
|
||||
});
|
||||
|
||||
var langTemplate = _.template([
|
||||
'<a id="<%= id %>" tabindex="-1" type="menuitem" langval="<%= value %>" class="<% if (checked) { %> checked <% } %>">',
|
||||
'<i class="icon <% if (spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= caption %>',
|
||||
'<a id="<%= id %>" tabindex="-1" type="menuitem" langval="<%= value.value %>" class="<% if (checked) { %> checked <% } %>">',
|
||||
'<div>',
|
||||
'<i class="icon <% if (spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= caption %>',
|
||||
'</div>',
|
||||
'<label style="opacity: 0.6"><%= captionEn %></label>',
|
||||
'</a>'
|
||||
].join(''));
|
||||
|
||||
@ -684,6 +687,7 @@ define([], function () {
|
||||
items : [],
|
||||
itemTemplate: langTemplate,
|
||||
search: true,
|
||||
searchFields: ['caption', 'captionEn'],
|
||||
focusToCheckedItem: true
|
||||
})
|
||||
});
|
||||
@ -754,6 +758,7 @@ define([], function () {
|
||||
items : [],
|
||||
itemTemplate: langTemplate,
|
||||
search: true,
|
||||
searchFields: ['caption', 'captionEn'],
|
||||
focusToCheckedItem: true
|
||||
})
|
||||
});
|
||||
@ -1784,4 +1789,4 @@ define([], function () {
|
||||
this.fireEvent('createdelayedelements', [this, 'edit']);
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -263,12 +263,16 @@ define([
|
||||
restoreHeight: 285,
|
||||
itemTemplate: _.template([
|
||||
'<a id="<%= id %>" tabindex="-1" type="menuitem" langval="<%= value.value %>" class="<% if (checked) { %> checked <% } %>">',
|
||||
'<i class="icon <% if (spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= caption %>',
|
||||
'<div>',
|
||||
'<i class="icon <% if (spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>',
|
||||
'<%= caption %>',
|
||||
'</div>',
|
||||
'<label style="opacity: 0.6"><%= captionEn %></label>',
|
||||
'</a>'
|
||||
].join('')),
|
||||
menuAlign: 'bl-tl',
|
||||
search: true,
|
||||
searchFields: ['caption', 'captionEn'],
|
||||
focusToCheckedItem: true
|
||||
});
|
||||
|
||||
@ -276,7 +280,7 @@ define([
|
||||
parentEl: $('#btn-cnt-lang', this.el),
|
||||
cls : 'btn-toolbar',
|
||||
scaling : false,
|
||||
caption : 'English (United States)',
|
||||
caption : 'English – United States',
|
||||
hint: this.tipSetLang,
|
||||
hintAnchor : 'top-left',
|
||||
disabled: true,
|
||||
@ -349,6 +353,7 @@ define([
|
||||
_.each(array, function(item) {
|
||||
arr.push({
|
||||
caption : item['displayValue'],
|
||||
captionEn : item['displayValueEn'],
|
||||
value : {value: item['value'], code: item['code']},
|
||||
checkable : true,
|
||||
checked : saved == item['displayValue'],
|
||||
@ -418,4 +423,4 @@ define([
|
||||
textSlideMaster: 'Slide master'
|
||||
}, PE.Views.Statusbar || {}));
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user