From 223f97038c98d1a96c6665bb7881a853d6310a65 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 13 Aug 2024 17:54:13 +0800 Subject: [PATCH] :globe_with_meridians: Localize more pages --- lang/en-US.json | 10 +++++++++- lang/zh-CN.json | 10 +++++++++- middleware/auth.ts | 4 ++-- pages/products/[...slug].vue | 16 +++++++++------- pages/products/index.vue | 6 ++++-- pages/users/[...name].vue | 11 +++++++---- pages/users/me.vue | 11 ++++++----- 7 files changed, 46 insertions(+), 22 deletions(-) diff --git a/lang/en-US.json b/lang/en-US.json index b289535..92b24e0 100644 --- a/lang/en-US.json +++ b/lang/en-US.json @@ -32,5 +32,13 @@ "multiFactorHint": "Check your inbox", "multiFactorTypeEmail": "Email One-time-password", "signInCompleted": "All Done", - "signInCompletedCaption": "Welcome back! You just signed in right now! We're going to direct you to dashboard..." + "signInCompletedCaption": "Welcome back! You just signed in right now! We're going to direct you to dashboard...", + "transferredToSolianHint": "This part of the functionality has been transferred to our application Solian, please download it or open it in your browser. To learn more, please visit the project description page.", + "personalize": "Personalize", + "personalizeCaption": "Bring your own color to the Solar Network.", + "security": "Security", + "securityCaption": "Guard your Solar Network account.", + "userActivity": "Activity", + "userActivityCaption": "Recent posts of this user.", + "productArchived": "Archived" } diff --git a/lang/zh-CN.json b/lang/zh-CN.json index 6dc3664..7dd4915 100644 --- a/lang/zh-CN.json +++ b/lang/zh-CN.json @@ -32,5 +32,13 @@ "multiFactorHint": "检查您的收件箱", "multiFactorTypeEmail": "电子邮件一次性密码", "signInCompleted": "完成", - "signInCompletedCaption": "欢迎回来!您刚刚登录成功!我们将引导您进入仪表板..." + "signInCompletedCaption": "欢迎回来!您刚刚登录成功!我们将引导您进入仪表板...", + "transferredToSolianHint": "此部分功能已转移到我们的应用程序 Solian,请下载或在浏览器中打开。如需了解更多信息,请访问项目描述页面。", + "personalize": "个性化", + "personalizeCaption": "为 Solar Network 染上你的色彩。", + "security": "安全", + "securityCaption": "保护您的 Solar Network 账户。", + "userActivity": "活动", + "userActivityCaption": "此用户的最新帖子。", + "productArchived": "已归档" } diff --git a/middleware/auth.ts b/middleware/auth.ts index ebb83aa..ad69709 100644 --- a/middleware/auth.ts +++ b/middleware/auth.ts @@ -1,7 +1,7 @@ export default defineNuxtRouteMiddleware((to, from) => { - const state = useLoggedInState(); + const id = useUserinfo(); - if (!state.value) { + if (!id.isLoggedIn) { return navigateTo(`/auth/sign-in?redirect_uri=${to.fullPath}`) } }) diff --git a/pages/products/[...slug].vue b/pages/products/[...slug].vue index d2d527c..84c86a1 100644 --- a/pages/products/[...slug].vue +++ b/pages/products/[...slug].vue @@ -18,7 +18,7 @@ size="small" class="mx-[-6px]" > - Archived + {{ t("productArchived") }} @@ -41,10 +41,10 @@