mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Add Simplified Chinese language.
Update language popup. + Merge conflict origin/master
This commit is contained in:
commit
101f956fa8
25 changed files with 1055 additions and 458 deletions
|
|
@ -30,12 +30,21 @@ function AdminGeneral()
|
|||
};
|
||||
});
|
||||
});
|
||||
|
||||
this.mainLanguageFullName = ko.computed(function () {
|
||||
return Utils.convertLangName(this.mainLanguage());
|
||||
}, this);
|
||||
|
||||
this.languagesOptions = ko.computed(function () {
|
||||
return _.map(oData.languages(), function (sLanguage) {
|
||||
var
|
||||
sName = Utils.convertLangName(sLanguage),
|
||||
sEn = Utils.convertLangName(sLanguage, true)
|
||||
;
|
||||
|
||||
return {
|
||||
'optValue': sLanguage,
|
||||
'optText': Utils.convertLangName(sLanguage)
|
||||
'optText': sName + (sEn !== sName ? ' (' + sEn + ')' : '')
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
@ -120,3 +129,8 @@ AdminGeneral.prototype.onBuild = function ()
|
|||
|
||||
}, 50);
|
||||
};
|
||||
|
||||
AdminGeneral.prototype.selectLanguage = function ()
|
||||
{
|
||||
kn.showScreenPopup(PopupsLanguagesViewModel);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ RainLoopApp.prototype.bootstart = function ()
|
|||
bTwitter = this.settingsGet('AllowTwitterSocial')
|
||||
;
|
||||
|
||||
if (!this.settingsGet('RemoteChangePassword'))
|
||||
if (!this.settingsGet('AllowChangePassword'))
|
||||
{
|
||||
Utils.removeSettingsViewModel(SettingsChangePasswordScreen);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1187,11 +1187,13 @@ Utils.microtime = function ()
|
|||
/**
|
||||
*
|
||||
* @param {string} sLanguage
|
||||
* @param {boolean=} bEng = false
|
||||
* @return {string}
|
||||
*/
|
||||
Utils.convertLangName = function (sLanguage)
|
||||
Utils.convertLangName = function (sLanguage, bEng)
|
||||
{
|
||||
return Utils.i18n('LANGS_NAMES/LANG_' + sLanguage.toUpperCase().replace(/[^a-zA-Z0-9]+/, '_'), null, sLanguage);
|
||||
return Utils.i18n('LANGS_NAMES' + (true === bEng ? '_EN' : '') + '/LANG_' +
|
||||
sLanguage.toUpperCase().replace(/[^a-zA-Z0-9]+/, '_'), null, sLanguage);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,14 +34,14 @@ function WebMailDataStorage()
|
|||
this.devPassword = '';
|
||||
|
||||
this.accountEmail = ko.observable('');
|
||||
this.accountLogin = ko.observable('');
|
||||
this.accountIncLogin = ko.observable('');
|
||||
this.accountOutLogin = ko.observable('');
|
||||
this.projectHash = ko.observable('');
|
||||
|
||||
this.threading = ko.observable(false);
|
||||
this.lastFoldersHash = '';
|
||||
|
||||
this.remoteSuggestions = false;
|
||||
this.remoteChangePassword = false;
|
||||
|
||||
// system folders
|
||||
this.sentFolder = ko.observable('');
|
||||
|
|
@ -389,7 +389,8 @@ WebMailDataStorage.prototype.populateDataOnStart = function()
|
|||
AbstractData.prototype.populateDataOnStart.call(this);
|
||||
|
||||
this.accountEmail(RL.settingsGet('Email'));
|
||||
this.accountLogin(RL.settingsGet('Login'));
|
||||
this.accountIncLogin(RL.settingsGet('IncLogin'));
|
||||
this.accountOutLogin(RL.settingsGet('OutLogin'));
|
||||
this.projectHash(RL.settingsGet('ProjectHash'));
|
||||
|
||||
this.displayName(RL.settingsGet('DisplayName'));
|
||||
|
|
@ -399,7 +400,6 @@ WebMailDataStorage.prototype.populateDataOnStart = function()
|
|||
this.lastFoldersHash = RL.local().get(Enums.ClientSideKeyName.FoldersLashHash) || '';
|
||||
|
||||
this.remoteSuggestions = !!RL.settingsGet('RemoteSuggestions');
|
||||
this.remoteChangePassword = !!RL.settingsGet('RemoteChangePassword');
|
||||
|
||||
this.devEmail = RL.settingsGet('DevEmail');
|
||||
this.devLogin = RL.settingsGet('DevLogin');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
|
||||
.b-admin-general {
|
||||
}
|
||||
|
||||
|
||||
.b-admin-general {
|
||||
.flag-selector {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.flag-name {
|
||||
border-bottom: 1px dashed #555;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
&.modal {
|
||||
z-index: 1103;
|
||||
width: 520px;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
&.exp {
|
||||
width: 521px;
|
||||
width: 501px;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
display: inline-block;
|
||||
padding: 5px 15px;
|
||||
margin: 2px 5px;
|
||||
width: 200px;
|
||||
width: 180px;
|
||||
background-color: #fff;
|
||||
text-align: left;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,26 +11,40 @@ function PopupsLanguagesViewModel()
|
|||
this.exp = ko.observable(false);
|
||||
|
||||
this.languages = ko.computed(function () {
|
||||
var sCurrent = RL.data().mainLanguage();
|
||||
return _.map(RL.data().languages(), function (sLanguage) {
|
||||
return {
|
||||
'key': sLanguage,
|
||||
'selected': sLanguage === sCurrent,
|
||||
'selected': ko.observable(false),
|
||||
'fullName': Utils.convertLangName(sLanguage)
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
RL.data().mainLanguage.subscribe(function () {
|
||||
this.resetMainLanguage();
|
||||
}, this);
|
||||
}
|
||||
|
||||
Utils.extendAsViewModel('PopupsLanguagesViewModel', PopupsLanguagesViewModel);
|
||||
|
||||
PopupsLanguagesViewModel.prototype.languageEnName = function (sLanguage)
|
||||
{
|
||||
return Utils.convertLangName(sLanguage, true);
|
||||
};
|
||||
|
||||
PopupsLanguagesViewModel.prototype.resetMainLanguage = function ()
|
||||
{
|
||||
var sCurrent = RL.data().mainLanguage();
|
||||
_.each(this.languages(), function (oItem) {
|
||||
oItem['selected'](oItem['key'] === sCurrent);
|
||||
});
|
||||
};
|
||||
|
||||
PopupsLanguagesViewModel.prototype.onShow = function ()
|
||||
{
|
||||
// var self = this;
|
||||
// _.defer(function () {
|
||||
// self.exp(true);
|
||||
// });
|
||||
this.exp(true);
|
||||
|
||||
this.resetMainLanguage();
|
||||
};
|
||||
|
||||
PopupsLanguagesViewModel.prototype.onHide = function ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue