From a50a45f4c350091693d3d2d8d3856de47fcc09f4 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Mon, 29 Aug 2022 15:48:56 +0100 Subject: [PATCH 1/2] add translation options --- src/utils/tabs.js | 1 - src/views/settings/components/tabs.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/tabs.js b/src/utils/tabs.js index 2c2e2883..eaf92024 100644 --- a/src/utils/tabs.js +++ b/src/utils/tabs.js @@ -4,7 +4,6 @@ export const tabs = [ { label: 'Captcha', path: 'captcha', tab: ':captcha' }, { label: 'Emoji', path: 'emoji', tab: ':emoji' }, { label: 'Frontend', path: 'frontend', tab: ':frontend' }, - { label: 'Gopher', path: 'gopher', tab: ':gopher' }, { label: 'HTTP', path: 'http', tab: ':http' }, { label: 'Instance', path: 'instance', tab: ':instance' }, { label: 'Job queue', path: 'job-queue', tab: ':job_queue' }, diff --git a/src/views/settings/components/tabs.js b/src/views/settings/components/tabs.js index a0e4d0e9..6bf13028 100644 --- a/src/views/settings/components/tabs.js +++ b/src/views/settings/components/tabs.js @@ -26,7 +26,7 @@ export const tabs = description => { }, 'instance': { label: 'settings.instance', - settings: [':admin_token', ':instance', ':instance_panel', ':instances_favicons', ':welcome', ':manifest', 'Pleroma.User', 'Pleroma.ScheduledActivity', ':uri_schemes', ':feed', ':streamer', ':restrict_unauthenticated'] + settings: [':admin_token', ':instance', ':instance_panel', ':instances_favicons', ':welcome', ':manifest', 'Pleroma.User', 'Pleroma.ScheduledActivity', ':uri_schemes', ':feed', ':streamer', ':restrict_unauthenticated', ':translator', ':deepl', ':libre_translate'] }, 'job-queue': { label: 'settings.jobQueue', -- 2.43.0 From 5766a94562095cb7a9bb9ed18f1ba52498530a8b Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Mon, 29 Aug 2022 18:39:50 +0100 Subject: [PATCH 2/2] add search/translation options --- src/lang/en.js | 2 +- src/utils/tabs.js | 1 + src/views/settings/components/Instance.vue | 35 + .../components/{Gopher.vue => Search.vue} | 38 +- src/views/settings/components/index.js | 2 +- src/views/settings/components/tabs.js | 4 + src/views/settings/index.vue | 6 +- yarn.lock | 4958 +++++++++-------- 8 files changed, 2761 insertions(+), 2285 deletions(-) rename src/views/settings/components/{Gopher.vue => Search.vue} (55%) diff --git a/src/lang/en.js b/src/lang/en.js index 0864fdb0..e679698a 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -412,6 +412,7 @@ export default { submit: 'Submit', settings: 'Settings', instance: 'Instance', + search: 'Search', upload: 'Upload', mailer: 'Mailer', linkFormatter: 'Link Formatter', @@ -425,7 +426,6 @@ export default { mrf: 'MRF', mediaProxy: 'Media Proxy', metadata: 'Metadata', - gopher: 'Gopher', jobQueue: 'Job queue', webPush: 'Web push encryption', rateLimiters: 'Rate limiters', diff --git a/src/utils/tabs.js b/src/utils/tabs.js index eaf92024..a0faf9d3 100644 --- a/src/utils/tabs.js +++ b/src/utils/tabs.js @@ -16,5 +16,6 @@ export const tabs = [ { label: 'Rate limiters', path: 'rate-limiters', tab: ':rate_limiters' }, { label: 'Web push encryption', path: 'web-push', tab: ':web_push' }, { label: 'Upload', path: 'upload', tab: ':upload' }, + { label: 'Search', path: 'search', tab: ':search' }, { label: 'Other', path: 'other', tab: ':other' } ] diff --git a/src/views/settings/components/Instance.vue b/src/views/settings/components/Instance.vue index 9e947667..bcc7ee76 100644 --- a/src/views/settings/components/Instance.vue +++ b/src/views/settings/components/Instance.vue @@ -44,6 +44,17 @@ + + + + + + + + + + +
{{ $t('settings.submit') }}
@@ -172,6 +183,30 @@ export default { }, welcomeData() { return _.get(this.settings.settings, [':pleroma', ':welcome']) || {} + }, + translator() { + return this.$store.state.settings.description.find(setting => setting.key === ':translator') + }, + translatorData() { + return _.get(this.settings.settings, [':pleroma', ':translator']) || {} + }, + usesDeepL() { + return (_.get(this.settings.settings, [':pleroma', ':translator', ':module']) || '').toLowerCase().endsWith('deepl') + }, + usesLibreTranslate() { + return (_.get(this.settings.settings, [':pleroma', ':translator', ':module']) || '').toLowerCase().endsWith('libretranslate') + }, + deepl() { + return this.$store.state.settings.description.find(setting => setting.key === ':deepl') + }, + deeplData() { + return _.get(this.settings.settings, [':pleroma', ':deepl']) || {} + }, + libre_translate() { + return this.$store.state.settings.description.find(setting => setting.key === ':libre_translate') + }, + libretranslateData() { + return _.get(this.settings.settings, [':pleroma', ':libre_translate']) || {} } }, async mounted() { diff --git a/src/views/settings/components/Gopher.vue b/src/views/settings/components/Search.vue similarity index 55% rename from src/views/settings/components/Gopher.vue rename to src/views/settings/components/Search.vue index 630d36d9..a9a10938 100644 --- a/src/views/settings/components/Gopher.vue +++ b/src/views/settings/components/Search.vue @@ -1,7 +1,13 @@