mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-24 06:30:32 +00:00
fix(mail(js)): use different email separator keys depending on locale
Fixes #3513 Fixes #4042 Fixes #5308 Fixes #5309
This commit is contained in:
@@ -163,14 +163,36 @@
|
||||
else
|
||||
data.SOGoContactsCategories = _.compact(data.SOGoContactsCategories);
|
||||
|
||||
data.emailSeparatorKeys = [
|
||||
9, // $mdConstant.KEY_CODE.TAB,
|
||||
13, // $mdConstant.KEY_CODE.ENTER,
|
||||
186, // $mdConstant.KEY_CODE.SEMICOLON
|
||||
188 // $mdConstant.KEY_CODE.COMMA,
|
||||
];
|
||||
if (data.LocaleCode) {
|
||||
data.ckLocaleCode = data.LocaleCode.replace('_', '-').toLowerCase();
|
||||
// Exceptions
|
||||
switch (data.LocaleCode) {
|
||||
case 'it':
|
||||
// The Italian keyboard layout has the same keycode (186) for '@' and ';'; we remove the semicolon.
|
||||
data.emailSeparatorKeys = [
|
||||
9, // $mdConstant.KEY_CODE.TAB,
|
||||
13, // $mdConstant.KEY_CODE.ENTER,
|
||||
188 // $mdConstant.KEY_CODE.COMMA,
|
||||
];
|
||||
break;
|
||||
case 'ru':
|
||||
// The Russian keyboard layout has the same keycode (186) for 'Ж' and ';'; we remove the semicolon.
|
||||
// It also has the same keycode (188) for 'Б' and ','; we remove the comma.
|
||||
data.emailSeparatorKeys = [
|
||||
9, // $mdConstant.KEY_CODE.TAB,
|
||||
13 // $mdConstant.KEY_CODE.ENTER,
|
||||
];
|
||||
break;
|
||||
case 'sr_ME':
|
||||
case 'sr_RS':
|
||||
data.ckLocaleCode = 'sr-latn';
|
||||
break;
|
||||
default:
|
||||
data.ckLocaleCode = data.LocaleCode.replace('_', '-').toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user