snappymail/dev/Stores/Language.js

19 lines
549 B
JavaScript
Raw Normal View History

import ko from 'ko';
2021-03-10 18:44:48 +08:00
import { Settings, SettingsGet } from 'Common/Globals';
import { isArray } from 'Common/Utils';
export const LanguageStore = {
2022-09-26 17:55:26 +08:00
language: ko.observable(''),
languages: ko.observableArray(),
userLanguage: ko.observable(''),
2022-12-12 20:03:41 +08:00
hourCycle: ko.observable(''),
populate: function() {
2021-03-10 18:44:48 +08:00
const aLanguages = Settings.app('languages');
this.languages(isArray(aLanguages) ? aLanguages : []);
this.language(SettingsGet('language'));
this.userLanguage(SettingsGet('userLanguage'));
2022-12-12 20:03:41 +08:00
this.hourCycle(SettingsGet('hourCycle'));
}
}