From 801b8fe027ca3e8fe7152cbb07eaf9d775b37eb4 Mon Sep 17 00:00:00 2001 From: Niklas Wolf Date: Sat, 21 Jan 2023 11:19:03 +0100 Subject: [PATCH 1/7] feat: add user preference to hide translation button (#1358) --- components/status/StatusTranslation.vue | 5 ++++- composables/settings/definition.ts | 2 ++ locales/de-DE.json | 1 + locales/en-US.json | 1 + pages/settings/preferences/index.vue | 6 ++++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/components/status/StatusTranslation.vue b/components/status/StatusTranslation.vue index eb090018..daf00a7e 100644 --- a/components/status/StatusTranslation.vue +++ b/components/status/StatusTranslation.vue @@ -10,6 +10,9 @@ const { translation, enabled: isTranslationEnabled, } = useTranslation(status, getLanguageCode()) +const preferenceHideTranslation = usePreferences('hideTranslation') + +const showButton = computed(() => !preferenceHideTranslation.value && isTranslationEnabled && status.language !== getLanguageCode()) let translating = $ref(false) const toggleTranslation = async () => { @@ -26,7 +29,7 @@ const toggleTranslation = async () => {