mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
42 lines
800 B
JavaScript
42 lines
800 B
JavaScript
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
var
|
|
_ = require('_'),
|
|
ko = require('ko'),
|
|
|
|
Utils = require('Common/Utils'),
|
|
|
|
Settings = require('Storage/Settings')
|
|
;
|
|
|
|
/**
|
|
* @constructor
|
|
*/
|
|
function LanguageStore()
|
|
{
|
|
this.languages = ko.observableArray([]);
|
|
this.languagesTop = ko.observableArray([]);
|
|
|
|
this.language = ko.observable('')
|
|
.extend({'limitedList': this.languages});
|
|
}
|
|
|
|
LanguageStore.prototype.populate = function ()
|
|
{
|
|
var
|
|
aLanguages = Settings.settingsGet('Languages'),
|
|
aLanguagesTop = Settings.settingsGet('LanguagesTop')
|
|
;
|
|
|
|
this.languages(Utils.isArray(aLanguages) ? aLanguages : []);
|
|
this.languagesTop(Utils.isArray(aLanguagesTop) ? aLanguagesTop : []);
|
|
|
|
this.language(Settings.settingsGet('Language'));
|
|
};
|
|
|
|
module.exports = new LanguageStore();
|
|
|
|
}());
|