2016-08-17 06:01:20 +08:00
|
|
|
import ko from 'ko';
|
2015-01-27 05:06:00 +08:00
|
|
|
|
2021-01-27 17:59:15 +08:00
|
|
|
export const LanguageStore = {
|
|
|
|
languages: ko.observableArray(),
|
|
|
|
userLanguage: ko.observable(''),
|
2015-01-27 05:06:00 +08:00
|
|
|
|
2021-01-27 17:59:15 +08:00
|
|
|
populate: function() {
|
2020-09-04 18:05:17 +08:00
|
|
|
const Settings = rl.settings,
|
2021-01-27 17:59:15 +08:00
|
|
|
aLanguages = Settings.app('languages');
|
2020-07-30 03:49:41 +08:00
|
|
|
this.languages(Array.isArray(aLanguages) ? aLanguages : []);
|
2020-09-04 18:05:17 +08:00
|
|
|
this.language(Settings.get('Language'));
|
|
|
|
this.userLanguage(Settings.get('UserLanguage'));
|
2016-08-17 06:01:20 +08:00
|
|
|
}
|
|
|
|
}
|
2015-01-27 05:06:00 +08:00
|
|
|
|
2021-01-27 17:59:15 +08:00
|
|
|
LanguageStore.language = ko.observable('')
|
|
|
|
.extend({ limitedList: LanguageStore.languages, reversible: true });
|