snappymail/dev/Stores/Language.js
2021-03-10 11:44:48 +01:00

17 lines
506 B
JavaScript

import ko from 'ko';
import { Settings, SettingsGet } from 'Common/Globals';
export const LanguageStore = {
languages: ko.observableArray(),
userLanguage: ko.observable(''),
populate: function() {
const aLanguages = Settings.app('languages');
this.languages(Array.isArray(aLanguages) ? aLanguages : []);
this.language(SettingsGet('Language'));
this.userLanguage(SettingsGet('UserLanguage'));
}
}
LanguageStore.language = ko.observable('')
.extend({ limitedList: LanguageStore.languages });