logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 4c158e636bd7ae9ec03a202e54aa681e66645a78
parent 3e1aeb6d2c9b540271bd0d7890ab424cb27422ae
Author: Henry Jameson <me@hjkos.com>
Date:   Wed, 12 Apr 2023 23:58:21 +0300

more i18n stuff, added missing labels and such

Diffstat:

Msrc/components/settings_modal/admin_tabs/instance_tab.vue12++++++++++++
Msrc/components/settings_modal/helpers/boolean_setting.vue2+-
Msrc/components/settings_modal/helpers/choice_setting.vue2+-
Msrc/components/settings_modal/helpers/number_setting.vue2+-
Msrc/components/settings_modal/helpers/setting.js41+++++++++++++++++++++++++++++++++++++++--
Msrc/components/settings_modal/helpers/string_setting.vue2+-
Msrc/i18n/en.json23++++++++++++++++++++++-
7 files changed, 77 insertions(+), 7 deletions(-)

diff --git a/src/components/settings_modal/admin_tabs/instance_tab.vue b/src/components/settings_modal/admin_tabs/instance_tab.vue @@ -58,6 +58,8 @@ <BooleanSetting path=":pleroma.:restrict_unauthenticated.:timelines.:local" indeterminate-state=":if_instance_is_private" + swap-description-and-label + hide-description > LOCAL TIMELINES </BooleanSetting> @@ -66,6 +68,8 @@ <BooleanSetting path=":pleroma.:restrict_unauthenticated.:timelines.:federated" indeterminate-state=":if_instance_is_private" + swap-description-and-label + hide-description > FED TIMELINES </BooleanSetting> @@ -82,6 +86,8 @@ <BooleanSetting path=":pleroma.:restrict_unauthenticated.:profiles.:local" indeterminate-state=":if_instance_is_private" + swap-description-and-label + hide-description > LOCAL PROFILES </BooleanSetting> @@ -90,6 +96,8 @@ <BooleanSetting path=":pleroma.:restrict_unauthenticated.:profiles.:remote" indeterminate-state=":if_instance_is_private" + swap-description-and-label + hide-description > FED PROFILES </BooleanSetting> @@ -106,6 +114,8 @@ <BooleanSetting path=":pleroma.:restrict_unauthenticated.:activities.:local" indeterminate-state=":if_instance_is_private" + swap-description-and-label + hide-description > LOCAL STATUSES </BooleanSetting> @@ -114,6 +124,8 @@ <BooleanSetting path=":pleroma.:restrict_unauthenticated.:activities.:remote" indeterminate-state=":if_instance_is_private" + swap-description-and-label + hide-description > FED STATUSES </BooleanSetting> diff --git a/src/components/settings_modal/helpers/boolean_setting.vue b/src/components/settings_modal/helpers/boolean_setting.vue @@ -14,7 +14,7 @@ class="label" :class="{ 'faint': shouldBeDisabled }" > - <template v-if="backendDescription"> + <template v-if="backendDescriptionLabel"> {{ backendDescriptionLabel }} </template> <template v-else> diff --git a/src/components/settings_modal/helpers/choice_setting.vue b/src/components/settings_modal/helpers/choice_setting.vue @@ -3,7 +3,7 @@ v-if="matchesExpertLevel" class="ChoiceSetting" > - <template v-if="backendDescription"> + <template v-if="backendDescriptionLabel"> {{ backendDescriptionLabel }} </template> <template v-else> diff --git a/src/components/settings_modal/helpers/number_setting.vue b/src/components/settings_modal/helpers/number_setting.vue @@ -4,7 +4,7 @@ class="NumberSetting" > <label :for="path" :class="{ 'faint': shouldBeDisabled }"> - <template v-if="backendDescription"> + <template v-if="backendDescriptionLabel"> {{ backendDescriptionLabel + ' ' }} </template> <template v-else> diff --git 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 diff --git a/src/components/settings_modal/helpers/string_setting.vue b/src/components/settings_modal/helpers/string_setting.vue @@ -4,7 +4,7 @@ class="StringSetting" > <label :for="path" :class="{ 'faint': shouldBeDisabled }"> - <template v-if="backendDescription"> + <template v-if="backendDescriptionLabel"> {{ backendDescriptionLabel + ' ' }} </template> <template v-else> diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -864,7 +864,14 @@ "instance": "Instance information", "registrations": "User sign-ups", "captcha_header": "CAPTCHA", - "kocaptcha": "KoCaptcha settings" + "kocaptcha": "KoCaptcha settings", + "access": "Instance access", + "restrict": { + "header": "Restrict access", + "timelines": "Timelines access", + "profiles": "User profiles access", + "activities": "Statues/activities access" + } }, "limits": { "arbitrary_limits": "Arbitrary limits", @@ -890,6 +897,20 @@ "default_frontend_tip": "Default front-end will be shown to all users. Currently there's no way to for a user to select personal front-end. If you switch away from PleromaFE you'll most likely have to use old and buggy AdminFE to do instance configuration until we replace it.", "default_frontend_tip2": "WIP: Since Pleroma backend doesn't properly list all installed frontends you'll have to enter name and reference manually. List below provides shortcuts to fill the values.", "available_frontends": "Available for install" + }, + "temp_overrides": { + ":pleroma": { + ":instance": { + ":description_limit": { + "label": "Limit", + "description": "Character limit for attachment descriptions" + }, + ":background_image": { + "label": "Background image", + "description": "Background image (primarily used by PleromaFE)" + } + } + } } }, "time": {