From 4c158e636bd7ae9ec03a202e54aa681e66645a78 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 12 Apr 2023 23:58:21 +0300 Subject: more i18n stuff, added missing labels and such --- src/components/settings_modal/helpers/setting.js | 41 ++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'src/components/settings_modal/helpers/setting.js') diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index 4f0be448..fec1b947 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -33,6 +33,18 @@ export default { type: String, default: undefined }, + hideDescription: { + type: Boolean + }, + swapDescriptionAndLabel: { + type: Boolean + }, + overrideBackendDescription: { + type: Boolean + }, + overrideBackendDescriptionLabel: { + type: Boolean + }, draftMode: { type: Boolean, default: undefined @@ -95,10 +107,35 @@ export default { return get(this.$store.state.adminSettings.descriptions, this.path) }, backendDescriptionLabel () { - return this.backendDescription?.label + if (this.realSource !== 'admin') return '' + if (!this.backendDescription || this.overrideBackendDescriptionLabel) { + return this.$t([ + 'admin_dash', + 'temp_overrides', + ...this.canonPath.map(p => p.replace(/\./g, '_DOT_')), + 'label' + ].join('.')) + } else { + return this.swapDescriptionAndLabel + ? this.backendDescription?.description + : this.backendDescription?.label + } }, backendDescriptionDescription () { - return this.backendDescription?.description + if (this.realSource !== 'admin') return '' + if (this.hideDescription) return null + if (!this.backendDescription || this.overrideBackendDescription) { + return this.$t([ + 'admin_dash', + 'temp_overrides', + ...this.canonPath.map(p => p.replace(/\./g, '_DOT_')), + 'description' + ].join('.')) + } else { + return this.swapDescriptionAndLabel + ? this.backendDescription?.label + : this.backendDescription?.description + } }, backendDescriptionSuggestions () { return this.backendDescription?.suggestions -- cgit v1.2.3-70-g09d2