feat: add translation

This commit is contained in:
2026-02-18 01:19:02 +08:00
parent df4fad2c5a
commit 1a8afd9573
6 changed files with 58 additions and 14 deletions

View File

@@ -49,10 +49,10 @@ const handleLogout = () => {
tabindex="-1" tabindex="-1"
class="dropdown-content z-1 w-100 p-2" class="dropdown-content z-1 w-100 p-2"
> >
<div class="card bg-base-200 w-96 mt-4 shadow-sm"> <div class="card bg-base-200 w-96 mt-5 shadow-sm">
<div class="card-body"> <div class="card-body">
<h2 class="card-title">现在加入!</h2> <h2 class="card-title">{{ $t("nav.login_more_title") }}</h2>
<p>登录我们的系统</p> <p>{{ $t("nav.login_more") }}</p>
<div class="card-actions justify-end"> <div class="card-actions justify-end">
<button <button
class="btn btn-sm" class="btn btn-sm"
@@ -83,10 +83,10 @@ const handleLogout = () => {
tabindex="-1" tabindex="-1"
class="dropdown-content z-1 w-100 p-2" class="dropdown-content z-1 w-100 p-2"
> >
<div class="card bg-base-200 w-96 mt-4 shadow-sm"> <div class="card bg-base-200 w-96 mt-5 shadow-sm">
<div class="card-body"> <div class="card-body">
<h2 class="card-title">退出登录</h2> <h2 class="card-title">{{ $t("nav.logout") }}</h2>
<p>切换您的账号</p> <p>{{ $t("nav.logout_more") }}</p>
<div class="card-actions justify-end"> <div class="card-actions justify-end">
<button class="btn btn-primary btn-sm" @click="handleLogout"> <button class="btn btn-primary btn-sm" @click="handleLogout">
{{ $t("nav.logout") }} {{ $t("nav.logout") }}

View File

@@ -129,7 +129,9 @@ const clickLoginButtonEvent = async () => {
<div class="flex items-center gap-16"> <div class="flex items-center gap-16">
<!-- 二维码登录区域 --> <!-- 二维码登录区域 -->
<div class="flex flex-col items-center gap-4 w-[200px]"> <div class="flex flex-col items-center gap-4 w-[200px]">
<div class="text-2xl select-none">扫描二维码登录</div> <div class="text-2xl select-none">
{{ t("auth.scan_qr") }}
</div>
<img <img
v-if="authQrcode" v-if="authQrcode"
:src="authQrcode" :src="authQrcode"
@@ -138,7 +140,7 @@ const clickLoginButtonEvent = async () => {
/> />
<div v-if="!authQrcode" class="skeleton h-48 w-48" /> <div v-if="!authQrcode" class="skeleton h-48 w-48" />
<div class="text-sm text-gray-500 select-none"> <div class="text-sm text-gray-500 select-none">
请打开手机微信 APP 扫码登录 {{ t("auth.scan_qr_more") }}
</div> </div>
</div> </div>
@@ -162,7 +164,7 @@ const clickLoginButtonEvent = async () => {
<!-- 注册暂未开放 --> <!-- 注册暂未开放 -->
<div class="tooltip"> <div class="tooltip">
<div class="tooltip-content"> <div class="tooltip-content">
<div class="font-black">暂未开放</div> <div class="font-black">{{ t("auth.not_open") }}</div>
</div> </div>
<div <div
class="text-2xl cursor-pointer transition duration-300" class="text-2xl cursor-pointer transition duration-300"

View File

@@ -9,6 +9,10 @@ export const en_USMessages: messagesInterface = {
login: "Login", login: "Login",
register: "Register", register: "Register",
logout: "Logout", logout: "Logout",
logout_more_title: "Logout Confirmation",
logout_more: "Ready to change account?",
login_more_title: "Join us Now!",
login_more: "Start your new develop experience",
}, },
auth: { auth: {
login: "Login", login: "Login",
@@ -23,5 +27,15 @@ export const en_USMessages: messagesInterface = {
agree_terms: "Agree to the Terms & Conditions", agree_terms: "Agree to the Terms & Conditions",
have_account: "Already have an account?", have_account: "Already have an account?",
logout: "Logout", logout: "Logout",
scan_qr: "Scan QR Code",
scan_qr_more: "Please open the phone's WeChat APP to scan the QR code",
not_open: "Not Open Yet",
},
home: {
welcome: "Welcome to Hucky",
intro_line1: "A Vue 3 + TypeScript + Vite template",
intro_line2: "with Vue I18n, Vue Router, and Vuex",
intro_line3: "and more...",
read_doc: "Read Documentation",
}, },
}; };

View File

@@ -11,6 +11,10 @@ export interface messagesInterface {
login: string; login: string;
register: string; register: string;
logout: string; logout: string;
logout_more_title: string;
logout_more: string;
login_more_title: string;
login_more: string;
}; };
auth: { auth: {
login: string; login: string;
@@ -25,6 +29,16 @@ export interface messagesInterface {
agree_terms: string; agree_terms: string;
have_account: string; have_account: string;
logout: string; logout: string;
scan_qr: string;
scan_qr_more: string;
not_open: string;
};
home: {
welcome: string;
intro_line1: string;
intro_line2: string;
intro_line3: string;
read_doc: string;
}; };
} }

View File

@@ -9,6 +9,10 @@ export const zh_CNMessages: messagesInterface = {
login: "登录", login: "登录",
register: "注册", register: "注册",
logout: "退出登录", logout: "退出登录",
logout_more_title: "退出登录",
logout_more: "准备切换新的账号吗或者是退出以保证您的安全吗?",
login_more_title: "加入我们",
login_more: "开始您的新开发体验",
}, },
auth: { auth: {
login: "登录", login: "登录",
@@ -23,5 +27,15 @@ export const zh_CNMessages: messagesInterface = {
agree_terms: "我同意《用户协议》相关条款和条件", agree_terms: "我同意《用户协议》相关条款和条件",
have_account: "已经有账号?", have_account: "已经有账号?",
logout: "退出登录", logout: "退出登录",
scan_qr: "扫描二维码登录",
scan_qr_more: "请打开手机微信 APP 扫码登录",
not_open: "暂未开放",
},
home: {
welcome: "欢迎来到 Hucky",
intro_line1: "超现代化的 Vue3 Based 脚手架",
intro_line2: "赋予您极致高效且规范的开发体验",
intro_line3: "使用 bun docs 命令启动 Hucky 的文档服务器",
read_doc: "阅读文档",
}, },
}; };

View File

@@ -46,17 +46,17 @@ const progress = ref([
<div class="hero flex-1"> <div class="hero flex-1">
<div class="hero-content text-center"> <div class="hero-content text-center">
<div class="max-w-md"> <div class="max-w-md">
<h1 class="text-5xl font-bold">欢迎加入</h1> <h1 class="text-5xl font-bold">{{ $t("home.welcome") }}</h1>
<p class="py-6"> <p class="py-6">
超现代化的 Vue3 Based 脚手架<br /> {{ $t("home.intro_line1") }}<br />
赋予您高效的开发体验<br /> {{ $t("home.intro_line2") }}<br />
使用 bun docs 命令启动 Hucky 的文档服务器 {{ $t("home.intro_line3") }}
</p> </p>
<button <button
class="btn btn-primary" class="btn btn-primary"
@click="navigateTo('http://localhost:5174')" @click="navigateTo('http://localhost:5174')"
> >
查阅文档 {{ $t("home.read_doc") }}
</button> </button>
</div> </div>
</div> </div>