fix(mail(js)): map the NSLocale to the proper CKEditor locale

This commit is contained in:
Francis Lachapelle
2022-03-21 15:57:51 -04:00
parent 06497a729c
commit 7c0592e03e
3 changed files with 13 additions and 2 deletions
@@ -43,7 +43,7 @@
// Set the locale of CKEditor
this.localeCode = Preferences.defaults.LocaleCode;
this.ckConfig = { language: Preferences.defaults.LocaleCode };
this.ckConfig = { language: Preferences.defaults.ckLocaleCode };
this.composeType = Preferences.defaults.SOGoMailComposeMessageType;
@@ -28,7 +28,7 @@
'toolbar': [['Bold', 'Italic', '-', 'Link',
'Font','FontSize','-','TextColor',
'BGColor', 'Source']],
language: defaults.LocaleCode
language: defaults.ckLocaleCode
};
if (!this.account.encryption)
@@ -163,6 +163,17 @@
else
data.SOGoContactsCategories = _.compact(data.SOGoContactsCategories);
if (data.LocaleCode) {
switch (data.LocaleCode) {
case 'sr_ME':
case 'sr_RS':
data.ckLocaleCode = 'sr-latn';
break;
default:
data.ckLocaleCode = data.LocaleCode.replace('_', '-').toLowerCase();
}
}
angular.extend(_this.defaults, data);
// Configure date locale