mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-28 10:32:28 +08:00
18 lines
549 B
JavaScript
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'));
|
|
}
|
|
}
|