diff options
| author | Henry Jameson <me@hjkos.com> | 2023-04-12 23:58:21 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2023-04-13 00:02:31 +0300 |
| commit | 4c158e636bd7ae9ec03a202e54aa681e66645a78 (patch) | |
| tree | 1754160398efe5576527f9717293197bf12840b9 /src/components/settings_modal/helpers/setting.js | |
| parent | 3e1aeb6d2c9b540271bd0d7890ab424cb27422ae (diff) | |
more i18n stuff, added missing labels and such
Diffstat (limited to 'src/components/settings_modal/helpers/setting.js')
| -rw-r--r-- | src/components/settings_modal/helpers/setting.js | 41 |
1 files changed, 39 insertions, 2 deletions
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 |
