snappymail/dev/Stores/Language.js
RainLoop Team aa84077ac4 Sound notification
Additional code refactoring
2015-01-27 01:06:00 +04:00

35 lines
598 B
JavaScript

(function () {
'use strict';
var
ko = require('ko'),
Utils = require('Common/Utils'),
Settings = require('Storage/Settings')
;
/**
* @constructor
*/
function LanguageStore()
{
this.languages = ko.observableArray([]);
this.language = ko.observable('')
.extend({'limitedList': this.languages});
}
LanguageStore.prototype.populate = function ()
{
var aLanguages = Settings.settingsGet('Languages');
this.languages(Utils.isArray(aLanguages) ? aLanguages : []);
this.language(Settings.settingsGet('Language'));
};
module.exports = new LanguageStore();
}());