🌐 Localize more pages

This commit is contained in:
LittleSheep 2024-08-13 17:54:13 +08:00
parent 4e42b44958
commit 223f97038c
7 changed files with 46 additions and 22 deletions

View File

@ -32,5 +32,13 @@
"multiFactorHint": "Check your inbox", "multiFactorHint": "Check your inbox",
"multiFactorTypeEmail": "Email One-time-password", "multiFactorTypeEmail": "Email One-time-password",
"signInCompleted": "All Done", "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"
} }

View File

@ -32,5 +32,13 @@
"multiFactorHint": "检查您的收件箱", "multiFactorHint": "检查您的收件箱",
"multiFactorTypeEmail": "电子邮件一次性密码", "multiFactorTypeEmail": "电子邮件一次性密码",
"signInCompleted": "完成", "signInCompleted": "完成",
"signInCompletedCaption": "欢迎回来!您刚刚登录成功!我们将引导您进入仪表板..." "signInCompletedCaption": "欢迎回来!您刚刚登录成功!我们将引导您进入仪表板...",
"transferredToSolianHint": "此部分功能已转移到我们的应用程序 Solian请下载或在浏览器中打开。如需了解更多信息请访问项目描述页面。",
"personalize": "个性化",
"personalizeCaption": "为 Solar Network 染上你的色彩。",
"security": "安全",
"securityCaption": "保护您的 Solar Network 账户。",
"userActivity": "活动",
"userActivityCaption": "此用户的最新帖子。",
"productArchived": "已归档"
} }

View File

@ -1,7 +1,7 @@
export default defineNuxtRouteMiddleware((to, from) => { 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}`) return navigateTo(`/auth/sign-in?redirect_uri=${to.fullPath}`)
} }
}) })

View File

@ -18,7 +18,7 @@
size="small" size="small"
class="mx-[-6px]" class="mx-[-6px]"
> >
Archived {{ t("productArchived") }}
</v-chip> </v-chip>
</v-col> </v-col>
</v-row> </v-row>
@ -41,10 +41,10 @@
</template> </template>
<template #not-found> <template #not-found>
<v-empty-state <v-empty-state
icon="mdi-flask-empty-remove-outline" icon="mdi-flask-empty-remove-outline"
text="We haven't this product, yet." text="We haven't this product, yet."
title="Not Found" title="Not Found"
class="no-content-placeholder" class="no-content-placeholder"
> >
<template #actions> <template #actions>
<v-btn prepend-icon="mdi-list-box" variant="plain" text="Back to index" to="/products" exact /> <v-btn prepend-icon="mdi-list-box" variant="plain" text="Back to index" to="/products" exact />
@ -64,8 +64,10 @@
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
const route = useRoute(); const route = useRoute()
const { data: page } = await useAsyncData('page', queryContent(route.path).findOne)
const { t } = useI18n()
const { data: page } = await useAsyncData("page", queryContent(route.path).findOne)
</script> </script>
<style scoped> <style scoped>

View File

@ -18,7 +18,7 @@
size="small" size="small"
class="mx-[-6px]" class="mx-[-6px]"
> >
Archived {{ t("productArchived") }}
</v-chip> </v-chip>
</v-col> </v-col>
</v-row> </v-row>
@ -29,9 +29,11 @@
<script setup lang="ts"> <script setup lang="ts">
useHead({ useHead({
title: 'Products', title: "Products",
}) })
const { t } = useI18n()
const { data: products } = await useAsyncData("products", () => queryContent("/products").find()) const { data: products } = await useAsyncData("products", () => queryContent("/products").find())
</script> </script>

View File

@ -13,12 +13,14 @@
<div class="mb-5 text-xs text-grey flex flex-col"> <div class="mb-5 text-xs text-grey flex flex-col">
<span>Solar Network User Web Preview</span> <span>Solar Network User Web Preview</span>
<span>To get full view of this user's profile, open it on <a class="underline" :href="externalOpenLink">Solian</a></span> <span>
To get full view of this user's profile, open it on <a class="underline" :href="externalOpenLink">Solian</a>
</span>
</div> </div>
<div> <div>
<h1 class="text-xl">Activity</h1> <h1 class="text-xl">{{ t("userActivity") }}</h1>
<span>Recent posts of this user.</span> <span>{{ t("userActivityCaption") }}</span>
</div> </div>
</div> </div>
@ -32,9 +34,10 @@
<script setup lang="ts"> <script setup lang="ts">
definePageMeta({ definePageMeta({
alias: ["/@:name(.*)*"] alias: ["/@:name(.*)*"],
}) })
const { t } = useI18n()
const route = useRoute() const route = useRoute()
const config = useRuntimeConfig() const config = useRuntimeConfig()

View File

@ -13,8 +13,8 @@
<div class="mb-5"> <div class="mb-5">
<div class="mx-[2.5ch]"> <div class="mx-[2.5ch]">
<h2 class="text-xl">Personalize</h2> <h2 class="text-xl">{{ t("personalize") }}</h2>
<span class="text-sm">Bring your own color to the Solar Network.</span> <span class="text-sm">{{ t("personalizeCaption") }}</span>
</div> </div>
<v-alert <v-alert
@ -22,14 +22,14 @@
type="info" type="info"
variant="tonal" variant="tonal"
density="comfortable" density="comfortable"
text="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." :text="t('transferredToSolianHint')"
/> />
</div> </div>
<div class="mb-5"> <div class="mb-5">
<div class="mx-[2.5ch]"> <div class="mx-[2.5ch]">
<h2 class="text-xl">Security</h2> <h2 class="text-xl">{{ t("security") }}</h2>
<span class="text-sm">Guard your Solar Network account.</span> <span class="text-sm">{{ t("securityCaption") }}</span>
</div> </div>
<account-auth-ticket-table class="mt-3" /> <account-auth-ticket-table class="mt-3" />
@ -47,6 +47,7 @@ definePageMeta({
middleware: ["auth"], middleware: ["auth"],
}) })
const { t } = useI18n()
const config = useRuntimeConfig() const config = useRuntimeConfig()
const auth = useUserinfo() const auth = useUserinfo()