snappymail/dev/Stores/Language.js
2022-12-12 13:03:41 +01:00

18 lines
549 B
JavaScript

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