From 7282b0d345ad3ca5b17b3f9ad93fce4383c13083 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Wed, 17 Apr 2024 14:43:02 +0800 Subject: [PATCH] chore: update --- locales/en.yaml | 32 ++++++++- locales/zh-CN.yaml | 30 +++++++++ src/layout/components/setting/index.vue | 86 +++++++++++++------------ 3 files changed, 107 insertions(+), 41 deletions(-) diff --git a/locales/en.yaml b/locales/en.yaml index 13c174df0..6c235ae28 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -17,6 +17,8 @@ buttons: pureSwitch: Switch pureClose: Close pureBackTop: BackTop + pureOpenText: Open + pureCloseText: Close search: pureTotal: Total pureHistory: History @@ -27,8 +29,36 @@ search: panel: pureSystemSet: System Configs pureCloseSystemSet: Close System Configs - pureClearCacheAndToLogin: Clear Cache And To Login Page + pureClearCacheAndToLogin: Clear cache and return to login page pureClearCache: Clear Cache + pureOverallStyle: Overall Style + pureOverallStyleLight: Light + pureOverallStyleLightTip: Set sail freshly and light up the comfortable work interface + pureOverallStyleDark: Dark + pureOverallStyleDarkTip: Moonlight Overture, indulge in the tranquility and elegance of the night + pureOverallStyleSystem: Auto + pureOverallStyleSystemTip: Synchronize time, the interface naturally responds to morning and dusk + pureThemeColor: Theme Color + pureLayoutModel: Layout Model + pureVerticalTip: The menu on the left is familiar and friendly + pureHorizontalTip: Top menu, concise overview + pureMixTip: Mixed menu, flexible + pureStretch: Stretch Page + pureStretchFixed: Fixed + pureStretchFixedTip: Compact pages make it easy to find the information you need + pureStretchCustom: Custom + pureStretchCustomTip: Minimum 1280, maximum 1600 + pureTagsStyle: Tags Style + pureTagsStyleSmart: Smart + pureTagsStyleSmartTip: Smart tags add fun and brilliance + pureTagsStyleCard: Card + pureTagsStyleCardTip: Card tags for efficient browsing + pureInterfaceDisplay: Interface Display + pureGreyModel: Grey Model + pureWeakModel: Weak Model + pureHiddenTags: Hidden Tags + pureHiddenFooter: Hidden Footer + pureMultiTagsCache: MultiTags Cache menus: pureHome: Home pureLogin: Login diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index 63c0f4d2a..ce4da125f 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -17,6 +17,8 @@ buttons: pureSwitch: 切换 pureClose: 关闭 pureBackTop: 回到顶部 + pureOpenText: 开 + pureCloseText: 关 search: pureTotal: 共 pureHistory: 搜索历史 @@ -29,6 +31,34 @@ panel: pureCloseSystemSet: 关闭配置 pureClearCacheAndToLogin: 清空缓存并返回登录页 pureClearCache: 清空缓存 + pureOverallStyle: 整体风格 + pureOverallStyleLight: 浅色 + pureOverallStyleLightTip: 清新启航,点亮舒适的工作界面 + pureOverallStyleDark: 深色 + pureOverallStyleDarkTip: 月光序曲,沉醉于夜的静谧雅致 + pureOverallStyleSystem: 自动 + pureOverallStyleSystemTip: 同步时光,界面随晨昏自然呼应 + pureThemeColor: 主题色 + pureLayoutModel: 导航模式 + pureVerticalTip: 左侧菜单,亲切熟悉 + pureHorizontalTip: 顶部菜单,简洁概览 + pureMixTip: 混合菜单,灵活多变 + pureStretch: 页宽 + pureStretchFixed: 固定 + pureStretchFixedTip: 紧凑页面,轻松找到所需信息 + pureStretchCustom: 自定义 + pureStretchCustomTip: 最小1280、最大1600 + pureTagsStyle: 页签风格 + pureTagsStyleSmart: 灵动 + pureTagsStyleSmartTip: 灵动标签,添趣生辉 + pureTagsStyleCard: 卡片 + pureTagsStyleCardTip: 卡片标签,高效浏览 + pureInterfaceDisplay: 界面显示 + pureGreyModel: 灰色模式 + pureWeakModel: 色弱模式 + pureHiddenTags: 隐藏标签页 + pureHiddenFooter: 隐藏页脚 + pureMultiTagsCache: 页签持久化 menus: pureHome: 首页 pureLogin: 登录 diff --git a/src/layout/components/setting/index.vue b/src/layout/components/setting/index.vue index 8761bfe34..269ca350a 100644 --- a/src/layout/components/setting/index.vue +++ b/src/layout/components/setting/index.vue @@ -9,6 +9,7 @@ import { onUnmounted, onBeforeMount } from "vue"; +import { useI18n } from "vue-i18n"; import panel from "../panel/index.vue"; import { emitter } from "@/utils/mitt"; import { useNav } from "@/layout/hooks/useNav"; @@ -26,6 +27,7 @@ import dayIcon from "@/assets/svg/day.svg?component"; import darkIcon from "@/assets/svg/dark.svg?component"; import systemIcon from "@/assets/svg/system.svg?component"; +const { t } = useI18n(); const { device } = useNav(); const { isDark } = useDark(); const { $storage } = useGlobal(); @@ -147,13 +149,13 @@ function setFalse(Doms): any { /** 页宽 */ const stretchTypeOptions: Array = [ { - label: "固定", - tip: "紧凑页面,轻松找到所需信息", + label: t("panel.pureStretchFixed"), + tip: t("panel.pureStretchFixedTip"), value: "fixed" }, { - label: "自定义", - tip: "最小1280、最大1600", + label: t("panel.pureStretchCustom"), + tip: t("panel.pureStretchCustomTip"), value: "custom" } ]; @@ -194,24 +196,24 @@ const pClass = computed(() => { const themeOptions = computed>(() => { return [ { - label: "浅色", + label: t("panel.pureOverallStyleLight"), icon: dayIcon, theme: "light", - tip: "清新启航,点亮舒适的工作界面", + tip: t("panel.pureOverallStyleLightTip"), iconAttrs: { fill: isDark.value ? "#fff" : "#000" } }, { - label: "深色", + label: t("panel.pureOverallStyleDark"), icon: darkIcon, theme: "dark", - tip: "月光序曲,沉醉于夜的静谧雅致", + tip: t("panel.pureOverallStyleDarkTip"), iconAttrs: { fill: isDark.value ? "#fff" : "#000" } }, { - label: "自动", + label: t("panel.pureOverallStyleSystem"), icon: systemIcon, theme: "system", - tip: "同步时光,界面随晨昏自然呼应", + tip: t("panel.pureOverallStyleSystemTip"), iconAttrs: { fill: isDark.value ? "#fff" : "#000" } } ]; @@ -219,13 +221,13 @@ const themeOptions = computed>(() => { const markOptions: Array = [ { - label: "灵动", - tip: "灵动标签,添趣生辉", + label: t("panel.pureTagsStyleSmart"), + tip: t("panel.pureTagsStyleSmartTip"), value: "smart" }, { - label: "卡片", - tip: "卡片标签,高效浏览", + label: t("panel.pureTagsStyleCard"), + tip: t("panel.pureTagsStyleCardTip"), value: "card" } ]; @@ -309,7 +311,7 @@ onUnmounted(() => removeMatchMedia);