complete aside, header and settings panel i18n

This commit is contained in:
KUN1007 2023-05-26 22:08:01 +08:00
parent 2dbc67efee
commit 88f42e7ad7
16 changed files with 107 additions and 61 deletions

View file

@ -33,11 +33,11 @@ interface topBar {
// //
const topBarItem: topBar[] = [ const topBarItem: topBar[] = [
{ index: 1, name: '所有帖子', router: '/pool' }, { index: 1, name: 'pool', router: '/pool' },
{ index: 2, name: '发布帖子', router: 'edit' }, { index: 2, name: 'create', router: 'edit' },
{ index: 3, name: '技术交流', router: 'technology' }, { index: 3, name: 'technique', router: 'technology' },
{ index: 4, name: '关于我们', router: 'kungalgame' }, { index: 4, name: 'about', router: 'kungalgame' },
{ index: 5, name: '返回主页', router: '/' }, { index: 5, name: 'return', router: '/' },
] ]
// header // header
@ -90,7 +90,9 @@ onBeforeMount(() => {})
<ul> <ul>
<!-- 顶部单个板块 --> <!-- 顶部单个板块 -->
<li v-for="kun in topBarItem" :key="kun.index"> <li v-for="kun in topBarItem" :key="kun.index">
<router-link :to="{ path: kun.router }">{{ kun.name }}</router-link> <router-link :to="{ path: kun.router }">{{
$t(`header['${kun.name}']`)
}}</router-link>
</li> </li>
<!-- 顶部板块下部的 hover 效果 --> <!-- 顶部板块下部的 hover 效果 -->
<div class="top-bar-box"></div> <div class="top-bar-box"></div>

View file

@ -55,12 +55,12 @@ const handleClose = () => {
<div class="root"> <div class="root">
<div class="container"> <div class="container">
<div class="title"> <div class="title">
<span>设置面板</span> <span>{{ $t('header.settings.name') }}</span>
<span><Icon class="settings-icon" icon="uiw:setting-o" /></span> <span><Icon class="settings-icon" icon="uiw:setting-o" /></span>
</div> </div>
<div class="mode"> <div class="mode">
<!-- 白天 / 黑夜模式切换 --> <!-- 白天 / 黑夜模式切换 -->
<span>模式切换</span> <span>{{ $t('header.settings.mode') }}</span>
<div class="mode-container"> <div class="mode-container">
<li> <li>
<Icon <Icon
@ -77,7 +77,7 @@ const handleClose = () => {
</div> </div>
</div> </div>
<div class="set-lang"> <div class="set-lang">
<span>网站语言设置</span> <span>{{ $t('header.settings.language') }}</span>
<select class="select" v-model="locale" @change="changeLanguage"> <select class="select" v-model="locale" @change="changeLanguage">
<option value="en">English</option> <option value="en">English</option>
<option value="zh">中文</option> <option value="zh">中文</option>
@ -86,7 +86,7 @@ const handleClose = () => {
<div> <div>
<!-- 设置主页的宽度 --> <!-- 设置主页的宽度 -->
<div class="width-container"> <div class="width-container">
<span>主页页面宽度设置</span> <span>{{ $t('header.settings.width') }}</span>
<span>{{ showMainPageWidth }}%</span> <span>{{ showMainPageWidth }}%</span>
</div> </div>
<div class="page-width"> <div class="page-width">
@ -104,7 +104,9 @@ const handleClose = () => {
<!-- 背景设置组件 --> <!-- 背景设置组件 -->
<Background /> <Background />
<div><button class="reset">恢复所有设置为默认</button></div> <div>
<button class="reset">{{ $t('header.settings.recover') }}</button>
</div>
</div> </div>
<!-- 看板娘组件 --> <!-- 看板娘组件 -->

View file

@ -4,10 +4,10 @@ import { useSettingsPanelStore } from '@/store/modules/settings'
<template> <template>
<div class="kungalgame-background"> <div class="kungalgame-background">
<div class="bg-settings">背景设置</div> <div class="bg-settings">{{ $t('header.settings.background') }}</div>
<ul class="kungalgame-background-container"> <ul class="kungalgame-background-container">
<li> <li>
<span>点击使用我们的预设的背景</span> <span>{{ $t('header.settings.preset') }}</span>
<!-- 预设背景集 --> <!-- 预设背景集 -->
<ul class="kungalgame-reset-bg"> <ul class="kungalgame-reset-bg">
<li><img src="@/assets/images/bg/bg1-m.png" /></li> <li><img src="@/assets/images/bg/bg1-m.png" /></li>
@ -23,15 +23,15 @@ import { useSettingsPanelStore } from '@/store/modules/settings'
</li> </li>
<!-- 用户自定义背景 --> <!-- 用户自定义背景 -->
<li> <li>
<span>自定义背景</span> <span>{{ $t('header.settings.custom') }}</span>
<div class="kungalgamer-bg"> <div class="kungalgamer-bg">
<span>请在这里粘贴图片url</span> <span>{{ $t('header.settings.url') }}</span>
<div class="bg-url-input"> <div class="bg-url-input">
<input type="text" required /> <input type="text" required />
<button>确定</button> <button>{{ $t('header.settings.confirm') }}</button>
</div> </div>
</div> </div>
<button class="reset-bg">恢复空白背景</button> <button class="reset-bg">{{ $t('header.settings.restore') }}</button>
</li> </li>
</ul> </ul>
</div> </div>

View file

@ -1,13 +1,35 @@
export default { export default {
header: { header: {
name: 'KUNGalgame', name: 'KUN Visual Novel',
allTopic: 'All TOPIC', pool: 'POOL',
createTopic: 'CREATE TOPIC', create: 'CREATE',
technology: 'TECHNOLOGY', technique: 'TECHNIQUE',
aboutUs: 'ABOUT US', about: 'ABOUT',
return: 'HOME',
settings: {
name: 'Settings',
mode: 'Mode',
language: 'Language',
width: 'Main Page Width',
background: 'Background Setting',
preset: 'Use our preset background',
custom: 'Custom Background',
url: 'Paste the picture url here',
confirm: 'confirm',
restore: 'Restore blank background',
recover: 'Recover all settings to default',
},
}, },
mainPage: { mainPage: {
asideActive: { asideActive: {
fold: 'Fold Aside',
create: 'CREATE NEW!',
update: 'Update Log',
balance: 'F.S.',
ranking: 'Ranking',
regulations: 'Regulations',
contacts: 'Join Us',
antiMoe: 'Anti-moe',
hot: `Today's Hot Topic`, hot: `Today's Hot Topic`,
new: `Today's New Topic`, new: `Today's New Topic`,
}, },

View file

@ -1,17 +1,32 @@
export default { export default {
header: { header: {
name: '鲲Galgame', name: '鲲Galgame',
allTopic: '所有帖子', pool: '所有帖子',
createTopic: '发布帖子', create: '发布帖子',
technology: '技术交流', technique: '技术交流',
aboutUs: '关于我们', about: '关于我们',
return: '返回主页',
settings: {
name: '设置面板',
mode: '模式切换',
language: '网站语言设置',
width: '主页页面宽度设置',
background: '背景设置',
preset: '点击使用我们预设的背景',
custom: '自定义背景',
url: '请在这里粘贴图片的URL',
confirm: '确定',
restore: '恢复空白背景',
recover: '恢复所有设置为默认',
},
}, },
mainPage: { mainPage: {
asideActive: { asideActive: {
fold: '折叠左侧区域', fold: '折叠左侧区域',
create: '发布帖子',
update: '更新日志', update: '更新日志',
balance: '收支公示', balance: '收支公示',
rank: '排行榜单', ranking: '排行榜单',
regulations: '执行条例', regulations: '执行条例',
contacts: '加入我们', contacts: '加入我们',
antiMoe: '不萌记录', antiMoe: '不萌记录',

View file

@ -157,9 +157,9 @@ export const constantRoutes: RouteRecordRaw[] = [
}, },
// KUNGalgame 排行榜 // KUNGalgame 排行榜
{ {
name: 'Rank', name: 'Ranking',
path: '/rank', path: '/ranking',
component: () => import('@/views/rank/Rank.vue'), component: () => import('@/views/ranking/Ranking.vue'),
meta: { meta: {
title: '排行榜', title: '排行榜',
transition: 'animate__backInUp', transition: 'animate__backInUp',

View file

@ -11,7 +11,7 @@
<a href="#"><span>鲲最可爱</span></a> <a href="#"><span>鲲最可爱</span></a>
</div> </div>
<!-- 发布者相关信息 --> <!-- 发布者相关信息 -->
<!-- <div class="kungalgamer-rank"></div> --> <!-- <div class="kungalgamer-ranking"></div> -->
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -46,7 +46,7 @@ watch(
style="font-size: 17px" style="font-size: 17px"
v-if="!isActive" v-if="!isActive"
/> />
<span v-if="isActive">折叠左侧区域</span> <span v-if="isActive">{{ $t('mainPage.asideActive.fold') }}</span>
</div> </div>
<div class="item-active" v-if="isActive"> <div class="item-active" v-if="isActive">
<AsideActive :isActive="isActive" /> <AsideActive :isActive="isActive" />

View file

@ -9,12 +9,12 @@ interface aside {
// 顶部导航栏的项目 TODO:i18n // 顶部导航栏的项目 TODO:i18n
const asideItem: aside[] = [ const asideItem: aside[] = [
{ index: 1, name: '更新日志', router: '/update-log' }, { index: 1, name: 'update', router: '/update-log' },
{ index: 2, name: '收支公示', router: '/balance' }, { index: 2, name: 'balance', router: '/balance' },
{ index: 3, name: '排行榜单', router: '/rank' }, { index: 3, name: 'ranking', router: '/ranking' },
{ index: 4, name: '执行条例', router: '/regulations' }, { index: 4, name: 'regulations', router: '/regulations' },
{ index: 5, name: '加入我们', router: '/contacts' }, { index: 5, name: 'contacts', router: '/contacts' },
{ index: 6, name: '不萌记录', router: '/anti-moe' }, { index: 6, name: 'antiMoe', router: '/anti-moe' },
] ]
export default asideItem export default asideItem

View file

@ -7,7 +7,9 @@ import asideItem from '../aside-item'
<div class="aside"> <div class="aside">
<!-- 顶部单个板块 --> <!-- 顶部单个板块 -->
<span v-for="kun in asideItem" :key="kun.index"> <span v-for="kun in asideItem" :key="kun.index">
<router-link :to="{ path: kun.router }">{{ kun.name }}</router-link> <router-link :to="{ path: kun.router }">{{
$t(`mainPage.asideActive['${kun.name}']`)
}}</router-link>
</span> </span>
</div> </div>
</template> </template>

View file

@ -15,13 +15,17 @@ const isActive = toRefs(props.isActive)
<!-- 发布新文章 --> <!-- 发布新文章 -->
<div class="new-article"> <div class="new-article">
<!-- 发布新文章的按钮 --> <!-- 发布新文章的按钮 -->
<button class="btn-new-article">发布帖子</button> <button class="btn-new-article">
{{ $t('mainPage.asideActive.create') }}
</button>
</div> </div>
<!-- 功能盒子容器 --> <!-- 功能盒子容器 -->
<div class="item-box-container"> <div class="item-box-container">
<!-- 侧边栏单个项目 --> <!-- 侧边栏单个项目 -->
<span v-for="kun in asideItem" :key="kun.index"> <span v-for="kun in asideItem" :key="kun.index">
<router-link :to="{ path: kun.router }">{{ kun.name }}</router-link> <router-link :to="{ path: kun.router }">{{
$t(`mainPage.asideActive['${kun.name}']`)
}}</router-link>
</span> </span>
</div> </div>
</div> </div>

View file

@ -11,7 +11,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<div class="header"> <div class="header">
<!-- 用户头像 --> <!-- 用户头像 -->
<div class="kungalgamer-avatar"> <div class="kungalgamer-avatar">
<img src="../img/KUN.jpg" alt="KUN" /> <img src="@/assets/images/KUN.jpg" alt="KUN" />
</div> </div>
<!-- 用户名 --> <!-- 用户名 -->
<div class="kungalgamer-name"> <div class="kungalgamer-name">
@ -57,7 +57,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
min-height: 800px; min-height: 800px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-image: url('$/assets/images/bg/bg3.png'); background-image: url('@/assets/images/bg/bg3.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-attachment: fixed; background-attachment: fixed;
@ -83,7 +83,6 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
flex-direction: column; flex-direction: column;
/* 用户页面的所有字体颜色 */ /* 用户页面的所有字体颜色 */
color: $kungalgame-font-color-3; color: $kungalgame-font-color-3;
overflow: hidden;
} }
/* 页面的头部 */ /* 页面的头部 */
.header { .header {

View file

@ -10,7 +10,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<!-- 内容区 --> <!-- 内容区 -->
<div class="article"> <div class="article">
<!-- 用户排行 --> <!-- 用户排行 -->
<div class="kungalgamer-rank"> <div class="kungalgamer-ranking">
<!-- 用户排行标题 --> <!-- 用户排行标题 -->
<div class="kungalgamer-title">最萌的萝莉</div> <div class="kungalgamer-title">最萌的萝莉</div>
<!-- 用户排行的交互 --> <!-- 用户排行的交互 -->
@ -371,7 +371,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
</div> </div>
</div> </div>
<!-- 帖子排行 --> <!-- 帖子排行 -->
<div class="topic-rank"> <div class="topic-ranking">
<!-- 帖子排行标题 --> <!-- 帖子排行标题 -->
<div class="topic-title">最萌的帖子</div> <div class="topic-title">最萌的帖子</div>
<!-- 帖子排行的交互 --> <!-- 帖子排行的交互 -->
@ -975,7 +975,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
color: $kungalgame-font-color-3; color: $kungalgame-font-color-3;
} }
/* 用户排行 */ /* 用户排行 */
.kungalgamer-rank { .kungalgamer-ranking {
width: 50%; width: 50%;
border-right: 1px solid $kungalgame-blue-4; border-right: 1px solid $kungalgame-blue-4;
box-sizing: border-box; box-sizing: border-box;
@ -1074,7 +1074,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
*/ */
/* 帖子排行 */ /* 帖子排行 */
.topic-rank { .topic-ranking {
width: 50%; width: 50%;
} }
/* 帖子排行标题 */ /* 帖子排行标题 */

View file

@ -51,7 +51,7 @@
<!-- 楼主的头像图片 --> <!-- 楼主的头像图片 -->
<img src="../img/KUN.jpg" alt="KUN" /> <img src="../img/KUN.jpg" alt="KUN" />
<!-- 楼主的等级 --> <!-- 楼主的等级 -->
<div class="master-rank">站长</div> <div class="master-ranking">站长</div>
</div> </div>
<!-- 楼主的名字 --> <!-- 楼主的名字 -->
<div class="master-name">啊这可海星啊这</div> <div class="master-name">啊这可海星啊这</div>
@ -355,7 +355,7 @@
margin-top: 17px; margin-top: 17px;
} }
/* 楼主的等级 */ /* 楼主的等级 */
.master-rank { .master-ranking {
font-size: 10px; font-size: 10px;
position: absolute; position: absolute;
margin-left: 90px; margin-left: 90px;

View file

@ -26,7 +26,7 @@ import Comments from './comments/Comments.vue'
<!-- 其他人的头像图片 --> <!-- 其他人的头像图片 -->
<img src="../img/KUN.jpg" alt="KUN" /> <img src="../img/KUN.jpg" alt="KUN" />
<!-- 其他人的等级 --> <!-- 其他人的等级 -->
<div class="other-rank">萌葱</div> <div class="other-ranking">萌葱</div>
</div> </div>
<!-- 其他人的名字 --> <!-- 其他人的名字 -->
<div class="other-name">啊这可海星啊这</div> <div class="other-name">啊这可海星啊这</div>
@ -220,7 +220,7 @@ import Comments from './comments/Comments.vue'
width: 100px; width: 100px;
} }
/* 其他人的等级 */ /* 其他人的等级 */
.other-rank { .other-ranking {
font-size: 10px; font-size: 10px;
position: absolute; position: absolute;
margin-left: 90px; margin-left: 90px;

View file

@ -45,7 +45,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<li> <li>
<!-- 更新内容 --> <!-- 更新内容 -->
<div class="performance"> <div class="performance">
<p>1. 添加新页面 rank page</p> <p>1. 添加新页面 ranking page</p>
<p>2. 修复关于我们页面缩放 BUG</p> <p>2. 修复关于我们页面缩放 BUG</p>
<p>3. 页面颜色调整</p> <p>3. 页面颜色调整</p>
</div> </div>
@ -57,7 +57,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<li> <li>
<!-- 更新内容 --> <!-- 更新内容 -->
<div class="performance"> <div class="performance">
<p>1. 添加新页面 rank page</p> <p>1. 添加新页面 ranking page</p>
<p>2. 修复关于我们页面缩放 BUG</p> <p>2. 修复关于我们页面缩放 BUG</p>
<p>3. 页面颜色调整</p> <p>3. 页面颜色调整</p>
</div> </div>
@ -69,7 +69,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<li> <li>
<!-- 更新内容 --> <!-- 更新内容 -->
<div class="performance"> <div class="performance">
<p>1. 添加新页面 rank page</p> <p>1. 添加新页面 ranking page</p>
<p>2. 修复关于我们页面缩放 BUG</p> <p>2. 修复关于我们页面缩放 BUG</p>
<p>3. 页面颜色调整</p> <p>3. 页面颜色调整</p>
</div> </div>
@ -81,7 +81,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<li> <li>
<!-- 更新内容 --> <!-- 更新内容 -->
<div class="performance"> <div class="performance">
<p>1. 添加新页面 rank page</p> <p>1. 添加新页面 ranking page</p>
<p>2. 修复关于我们页面缩放 BUG</p> <p>2. 修复关于我们页面缩放 BUG</p>
<p>3. 页面颜色调整</p> <p>3. 页面颜色调整</p>
</div> </div>
@ -93,7 +93,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<li> <li>
<!-- 更新内容 --> <!-- 更新内容 -->
<div class="performance"> <div class="performance">
<p>1. 添加新页面 rank page</p> <p>1. 添加新页面 ranking page</p>
<p>2. 修复关于我们页面缩放 BUG</p> <p>2. 修复关于我们页面缩放 BUG</p>
<p>3. 页面颜色调整</p> <p>3. 页面颜色调整</p>
</div> </div>
@ -105,7 +105,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<li> <li>
<!-- 更新内容 --> <!-- 更新内容 -->
<div class="performance"> <div class="performance">
<p>1. 添加新页面 rank page</p> <p>1. 添加新页面 ranking page</p>
<p>2. 修复关于我们页面缩放 BUG</p> <p>2. 修复关于我们页面缩放 BUG</p>
<p>3. 页面颜色调整</p> <p>3. 页面颜色调整</p>
</div> </div>
@ -117,7 +117,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<li> <li>
<!-- 更新内容 --> <!-- 更新内容 -->
<div class="performance"> <div class="performance">
<p>1. 添加新页面 rank page</p> <p>1. 添加新页面 ranking page</p>
<p>2. 修复关于我们页面缩放 BUG</p> <p>2. 修复关于我们页面缩放 BUG</p>
<p>3. 页面颜色调整</p> <p>3. 页面颜色调整</p>
</div> </div>
@ -129,7 +129,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<li> <li>
<!-- 更新内容 --> <!-- 更新内容 -->
<div class="performance"> <div class="performance">
<p>1. 添加新页面 rank page</p> <p>1. 添加新页面 ranking page</p>
<p>2. 修复关于我们页面缩放 BUG</p> <p>2. 修复关于我们页面缩放 BUG</p>
<p>3. 页面颜色调整</p> <p>3. 页面颜色调整</p>
</div> </div>
@ -141,7 +141,7 @@ import KUNGalgameTopBar from '@/components/KUNGalgameTopBar.vue'
<li> <li>
<!-- 更新内容 --> <!-- 更新内容 -->
<div class="performance"> <div class="performance">
<p>1. 添加新页面 rank page</p> <p>1. 添加新页面 ranking page</p>
<p>2. 修复关于我们页面缩放 BUG</p> <p>2. 修复关于我们页面缩放 BUG</p>
<p>3. 页面颜色调整</p> <p>3. 页面颜色调整</p>
</div> </div>