mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-18 13:05:57 +00:00
(js) Fix SCAYT automatic language selection
This commit is contained in:
1
NEWS
1
NEWS
@@ -12,6 +12,7 @@ Bug fixes
|
||||
- [core] remove attendees that have the same identity as the organizer (#3905)
|
||||
- [eas] improved EAS parameters parsing (#4003)
|
||||
- [eas] properly handle canceled appointments
|
||||
- [web] fixed SCAYT automatic language selection in HTML editor
|
||||
|
||||
2.3.19 (2017-01-09)
|
||||
-------------------
|
||||
|
||||
@@ -533,7 +533,8 @@ function initMailEditor() {
|
||||
CKEDITOR.replace('text',
|
||||
{
|
||||
language : localeCode,
|
||||
scayt_sLang : localeCode
|
||||
scayt_disableOptionsStorage : 'lang',
|
||||
scayt_sLang : scaytLang(localeCode)
|
||||
}
|
||||
);
|
||||
CKEDITOR.on('instanceReady', function(event) {
|
||||
|
||||
@@ -715,7 +715,8 @@ function onMailIdentitySignatureClick(event) {
|
||||
'BGColor'], ['Source']
|
||||
],
|
||||
language: localeCode,
|
||||
scayt_sLang: localeCode });
|
||||
scayt_disableOptionsStorage : 'lang',
|
||||
scayt_sLang : scaytLang(localeCode) });
|
||||
}
|
||||
}
|
||||
dialog.mailAccount = this.mailAccount;
|
||||
|
||||
@@ -2285,6 +2285,22 @@ function _disposeDialog() {
|
||||
}
|
||||
}
|
||||
|
||||
// Pickup the first matching language supported by SCAYT
|
||||
// See http://docs.ckeditor.com/#!/guide/dev_howtos_scayt
|
||||
function scaytLang(locale) {
|
||||
var i, langs, lang;
|
||||
|
||||
langs = ['en_US', 'en_GB', 'pt_BR', 'da_DK', 'nl_NL', 'en_CA', 'fi_FI', 'fr_FR', 'fr_CA', 'de_DE', 'el_GR', 'it_IT', 'nb_NO', 'pt_PT', 'es_ES', 'sv_SE'];
|
||||
lang = 'en_US';
|
||||
for (i = 0; i < langs.length; i++)
|
||||
if (langs[i].lastIndexOf(locale, 0) == 0) {
|
||||
lang = langs[i];
|
||||
break;
|
||||
}
|
||||
|
||||
return lang;
|
||||
}
|
||||
|
||||
function readCookie(name) {
|
||||
var foundCookie = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user