From a41a31732b6e579fe09876dbdacbb8897885ec2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Fri, 13 Jan 2023 02:35:26 +0800 Subject: [PATCH] revert: "feat: display i18n text on SSR" This reverts commit cafc995dde916f4049a2fa3b28cf4f7943cc1ab5. --- components/nav/NavSideItem.vue | 2 +- components/search/SearchWidget.vue | 7 ++++--- pages/[[server]]/explore.vue | 8 ++++---- pages/notifications.vue | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/components/nav/NavSideItem.vue b/components/nav/NavSideItem.vue index aa9c9243..81833884 100644 --- a/components/nav/NavSideItem.vue +++ b/components/nav/NavSideItem.vue @@ -66,7 +66,7 @@ const noUserVisual = computed(() => isMastoInitialised.value && props.userOnly &
- {{ text }} + {{ isHydrated ? text : ' ' }}
diff --git a/components/search/SearchWidget.vue b/components/search/SearchWidget.vue index ec4ad5c4..12d27f19 100644 --- a/components/search/SearchWidget.vue +++ b/components/search/SearchWidget.vue @@ -3,6 +3,7 @@ const query = ref('') const { accounts, hashtags, loading, statuses } = useSearch(query) const index = ref(0) +const { t } = useI18n() const el = ref() const router = useRouter() const { focused } = useFocusWithin(el) @@ -65,7 +66,7 @@ const activate = () => { bg-transparent outline="focus:none" pe-4 - :placeholder="$t('nav.search')" + :placeholder="isHydrated ? t('nav.search') : ''" pb="1px" placeholder-text-secondary @keydown.down.prevent="shift(1)" @@ -77,7 +78,7 @@ const activate = () => {
- {{ $t('search.search_desc') }} + {{ t('search.search_desc') }}
diff --git a/pages/[[server]]/explore.vue b/pages/[[server]]/explore.vue index 44e346b1..7495022b 100644 --- a/pages/[[server]]/explore.vue +++ b/pages/[[server]]/explore.vue @@ -4,20 +4,20 @@ const { t } = useI18n() const tabs = $computed(() => [ { to: isHydrated.value ? `/${currentServer.value}/explore` : '/explore', - display: t('tab.posts'), + display: isHydrated.value ? t('tab.posts') : '', }, { to: isHydrated.value ? `/${currentServer.value}/explore/tags` : '/explore/tags', - display: t('tab.hashtags'), + display: isHydrated.value ? t('tab.hashtags') : '', }, { to: isHydrated.value ? `/${currentServer.value}/explore/links` : '/explore/links', - display: t('tab.news'), + display: isHydrated.value ? t('tab.news') : '', }, // This section can only be accessed after logging in { to: isHydrated.value ? `/${currentServer.value}/explore/users` : '/explore/users', - display: t('tab.for_you'), + display: isHydrated.value ? t('tab.for_you') : '', disabled: !isMastoInitialised.value || !currentUser.value, }, ] as const) diff --git a/pages/notifications.vue b/pages/notifications.vue index 4f581165..96983161 100644 --- a/pages/notifications.vue +++ b/pages/notifications.vue @@ -10,12 +10,12 @@ const tabs = $computed(() => [ { name: 'all', to: '/notifications', - display: t('tab.notifications_all'), + display: isHydrated.value ? t('tab.notifications_all') : '', }, { name: 'mention', to: '/notifications/mention', - display: t('tab.notifications_mention'), + display: isHydrated.value ? t('tab.notifications_mention') : '', }, ] as const)