#195 Settings Group undefined not translated

This commit is contained in:
UKDTOM 2021-01-09 22:15:19 +01:00
parent c3f1a27694
commit b640f112a7
2 changed files with 10 additions and 7 deletions

View file

@ -88,7 +88,7 @@
Token: this.$store.getters.getAuthToken,
Address: this.$store.getters.getSelectedServerAddress});
log.debug('Options are: ' + JSON.stringify(Object.keys(this.$store.getters.getPMSSettings)))
this.selSectionOptions = Object.keys(this.$store.getters.getPMSSettings);
this.selSectionOptions = Object.keys(this.$store.getters.getPMSSettings).sort();
},
changedOptions() {
log.debug('Updating OnlyHidden Setting');

View file

@ -1,5 +1,6 @@
import axios from 'axios';
import {wtconfig, wtutils} from '../../components/modules/General/wtutils';
import i18n from '../../i18n';
const log = require('electron-log');
const {JSONPath} = require('jsonpath-plus');
@ -48,7 +49,7 @@ const actions = {
log.debug('Show all settings');
}
var PMSSettings = {};
PMSSettings['Undefined'] = {};
PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')] = {};
filteredResult.forEach(group => {
group = JSONPath({path: '$.group', json: group})[0]
if (group !== "") {
@ -64,15 +65,17 @@ const actions = {
jNode['default'] = JSONPath({path: '$.default', json: element})[0];
jNode['value'] = JSONPath({path: '$.value', json: element})[0];
if (JSONPath({path: '$.group', json: element}) == ""){
PMSSettings['Undefined'][id] = jNode;
log.debug('Ged: ' + i18n.t('Modules.PMS.Settings.Undefined'))
PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')][id] = jNode;
}
else {
PMSSettings[JSONPath({path: '$.group', json: element})][id] = jNode;
}
});
// Remove undefined category, if empty
if (Object.keys(PMSSettings['Undefined']).length === 0){
delete PMSSettings['Undefined'];
if (Object.keys(PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')]).length === 0){
delete PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')];
}
commit('UPDATE_PMS_SETTINGS', PMSSettings);
})