Commit 46743802 by vince

perf: optimize the naming of locale key

1 parent 25a1e93a
Showing 59 changed files with 209 additions and 209 deletions
{
"exclude": ["zx", "eslint", "eslint-plugin-unused-imports"]
}
...@@ -50,31 +50,31 @@ export class MenuController { ...@@ -50,31 +50,31 @@ export class MenuController {
const createDemosMenus = (role: 'admin' | 'super' | 'user') => { const createDemosMenus = (role: 'admin' | 'super' | 'user') => {
const roleWithMenus = { const roleWithMenus = {
admin: { admin: {
component: '/demos/access/backend/access-test-2', component: '/demos/access/backend/admin-visible',
meta: { meta: {
icon: 'mdi:button-cursor', icon: 'mdi:button-cursor',
title: 'page.demos.access.access-test-2', title: 'page.demos.access.adminVisible',
}, },
name: 'AccessBackendTest2', name: 'AccessBackendAdminVisible',
path: 'access-test-2', path: 'admin-visible',
}, },
super: { super: {
component: '/demos/access/backend/access-test-1', component: '/demos/access/backend/super-visible',
meta: { meta: {
icon: 'mdi:button-cursor', icon: 'mdi:button-cursor',
title: 'page.demos.access.access-test-1', title: 'page.demos.access.superVisible',
}, },
name: 'AccessBackendTest1', name: 'AccessBackendSuperVisible',
path: 'access-test-1', path: 'super-visible',
}, },
user: { user: {
component: '/demos/access/backend/access-test-3', component: '/demos/access/backend/user-visible',
meta: { meta: {
icon: 'mdi:button-cursor', icon: 'mdi:button-cursor',
title: 'page.demos.access.access-test-3', title: 'page.demos.access.userVisible',
}, },
name: 'AccessBackendTest3', name: 'AccessBackendUserVisible',
path: 'access-test-3', path: 'user-visible',
}, },
}; };
...@@ -105,7 +105,7 @@ export class MenuController { ...@@ -105,7 +105,7 @@ export class MenuController {
path: 'backend', path: 'backend',
meta: { meta: {
icon: 'mdi:cloud-key-outline', icon: 'mdi:cloud-key-outline',
title: 'page.demos.access.backend-control', title: 'page.demos.access.backendControl',
}, },
redirect: '/demos/access/backend/page-control', redirect: '/demos/access/backend/page-control',
children: [ children: [
...@@ -115,7 +115,7 @@ export class MenuController { ...@@ -115,7 +115,7 @@ export class MenuController {
component: '/demos/access/backend/index', component: '/demos/access/backend/index',
meta: { meta: {
icon: 'mdi:page-previous-outline', icon: 'mdi:page-previous-outline',
title: 'page.demos.access.page', title: 'page.demos.access.pageAccess',
}, },
}, },
{ {
...@@ -124,7 +124,7 @@ export class MenuController { ...@@ -124,7 +124,7 @@ export class MenuController {
component: '/demos/access/backend/button-control', component: '/demos/access/backend/button-control',
meta: { meta: {
icon: 'mdi:button-cursor', icon: 'mdi:button-cursor',
title: 'page.demos.access.button', title: 'page.demos.access.buttonControl',
}, },
}, },
roleWithMenus[role], roleWithMenus[role],
......
import type { UserInfo } from '@vben/types'; import type { UserInfo } from '@vben/types';
import type { UserApiType } from '../types'; import type { UserApi } from '../types';
import { requestClient } from '#/forward'; import { requestClient } from '#/forward';
/** /**
* 登录 * 登录
*/ */
async function userLogin(data: UserApiType.LoginParams) { async function userLogin(data: UserApi.LoginParams) {
return requestClient.post<UserApiType.LoginResult>('/auth/login', data); return requestClient.post<UserApi.LoginResult>('/auth/login', data);
} }
/** /**
......
namespace UserApiType { namespace UserApi {
/** 登录接口参数 */ /** 登录接口参数 */
export interface LoginParams { export interface LoginParams {
password: string; password: string;
...@@ -16,4 +16,4 @@ namespace UserApiType { ...@@ -16,4 +16,4 @@ namespace UserApiType {
} }
} }
export type { UserApiType }; export type { UserApi };
...@@ -17,7 +17,7 @@ async function bootstrap(namespace: string) { ...@@ -17,7 +17,7 @@ async function bootstrap(namespace: string) {
await setupI18n(app, { await setupI18n(app, {
defaultLocale: preferences.app.locale, defaultLocale: preferences.app.locale,
loadMessages, loadMessages,
missingWarn: import.meta.env.PROD, missingWarn: !import.meta.env.PROD,
}); });
// 配置 pinia-store // 配置 pinia-store
......
...@@ -25,7 +25,7 @@ async function generateAccess(options: GeneratorMenuAndRoutesOptions) { ...@@ -25,7 +25,7 @@ async function generateAccess(options: GeneratorMenuAndRoutesOptions) {
...options, ...options,
fetchMenuListAsync: async () => { fetchMenuListAsync: async () => {
message.loading({ message.loading({
content: `${$t('common.loading-menu')}...`, content: `${$t('common.loadingMenu')}...`,
duration: 1.5, duration: 1.5,
}); });
return await getAllMenus(); return await getAllMenus();
......
...@@ -16,6 +16,7 @@ const localesMap = loadLocalesMap(modules); ...@@ -16,6 +16,7 @@ const localesMap = loadLocalesMap(modules);
/** /**
* 加载应用特有的语言包 * 加载应用特有的语言包
* 这里也可以改造为从服务端获取翻译数据
* @param lang * @param lang
*/ */
async function loadMessages(lang: SupportedLanguagesType) { async function loadMessages(lang: SupportedLanguagesType) {
......
...@@ -4,29 +4,28 @@ ...@@ -4,29 +4,28 @@
"title": "Demos", "title": "Demos",
"access": { "access": {
"title": "Access Control", "title": "Access Control",
"frontend-control": "Front-end Control", "frontendControl": "Frontend Control",
"backend-control": "Backend Control", "backendControl": "Backend Control",
"page": "Page visit", "pageAccess": "Page Access",
"button": "Button control", "buttonControl": "Button Control",
"loading-menu": "In the loading menu", "superVisible": "Visible to Super",
"access-test-1": "Super visit", "adminVisible": "Visible to Admin",
"access-test-2": "Admin visit", "userVisible": "Visible to User"
"access-test-3": "User visit"
}, },
"nested": { "nested": {
"title": "Nested Menu", "title": "Nested Menu",
"menu1": "Menu 1", "menu1": "Menu 1",
"menu2": "Menu 2", "menu2": "Menu 2",
"menu21": "Menu 2-1", "menu2_1": "Menu 2-1",
"menu3": "Menu 3", "menu3": "Menu 3",
"menu31": "Menu 3-1", "menu3_1": "Menu 3-1",
"menu32": "Menu 3-2", "menu3_2": "Menu 3-2",
"menu321": "Menu 3-2-1" "menu3_2_1": "Menu 3-2-1"
}, },
"outside": { "outside": {
"title": "External Page", "title": "External Pages",
"embedded": "embedded Page", "embedded": "Embedded",
"external-link": "External Link" "externalLink": "External Link"
}, },
"fallback": { "title": "Fallback Page" } "fallback": { "title": "Fallback Page" }
} }
......
...@@ -4,28 +4,28 @@ ...@@ -4,28 +4,28 @@
"title": "演示", "title": "演示",
"access": { "access": {
"title": "访问控制", "title": "访问控制",
"frontend-control": "前端控制", "frontendControl": "前端控制",
"backend-control": "后端控制", "backendControl": "后端控制",
"page": "页面访问", "pageAccess": "页面访问",
"button": "按钮控制", "buttonControl": "按钮控制",
"access-test-1": "Super 可见", "superVisible": "Super 可见",
"access-test-2": "Admin 可见", "adminVisible": "Admin 可见",
"access-test-3": "User 可见" "userVisible": "User 可见"
}, },
"nested": { "nested": {
"title": "嵌套菜单", "title": "嵌套菜单",
"menu1": "菜单 1", "menu1": "菜单 1",
"menu2": "菜单 2", "menu2": "菜单 2",
"menu21": "菜单 2-1", "menu2_1": "菜单 2-1",
"menu3": "菜单 3", "menu3": "菜单 3",
"menu31": "菜单 3-1", "menu3_1": "菜单 3-1",
"menu32": "菜单 3-2", "menu3_2": "菜单 3-2",
"menu321": "菜单 3-2-1" "menu3_2_1": "菜单 3-2-1"
}, },
"outside": { "outside": {
"title": "外部页面", "title": "外部页面",
"embedded": "内嵌", "embedded": "内嵌",
"external-link": "外链" "externalLink": "外链"
}, },
"fallback": { "fallback": {
"title": "缺省页" "title": "缺省页"
......
...@@ -60,7 +60,7 @@ const essentialsRoutes: RouteRecordRaw[] = [ ...@@ -60,7 +60,7 @@ const essentialsRoutes: RouteRecordRaw[] = [
component: () => component: () =>
import('#/views/_essential/authentication/qrcode-login.vue'), import('#/views/_essential/authentication/qrcode-login.vue'),
meta: { meta: {
title: $t('page.essentials.qrcode-login'), title: $t('page.essentials.qrcodeLogin'),
}, },
}, },
{ {
...@@ -69,7 +69,7 @@ const essentialsRoutes: RouteRecordRaw[] = [ ...@@ -69,7 +69,7 @@ const essentialsRoutes: RouteRecordRaw[] = [
component: () => component: () =>
import('#/views/_essential/authentication/forget-password.vue'), import('#/views/_essential/authentication/forget-password.vue'),
meta: { meta: {
title: $t('page.essentials.forget-password'), title: $t('page.essentials.forgetPassword'),
}, },
}, },
{ {
......
...@@ -31,7 +31,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -31,7 +31,7 @@ const routes: RouteRecordRaw[] = [
redirect: '/demos/access/frontend/page-control', redirect: '/demos/access/frontend/page-control',
meta: { meta: {
icon: 'mdi:table-key', icon: 'mdi:table-key',
title: $t('page.demos.access.frontend-control'), title: $t('page.demos.access.frontendControl'),
}, },
children: [ children: [
{ {
...@@ -41,7 +41,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -41,7 +41,7 @@ const routes: RouteRecordRaw[] = [
import('#/views/demos/access/frontend/index.vue'), import('#/views/demos/access/frontend/index.vue'),
meta: { meta: {
icon: 'mdi:page-previous-outline', icon: 'mdi:page-previous-outline',
title: $t('page.demos.access.page'), title: $t('page.demos.access.pageAccess'),
}, },
}, },
{ {
...@@ -51,40 +51,40 @@ const routes: RouteRecordRaw[] = [ ...@@ -51,40 +51,40 @@ const routes: RouteRecordRaw[] = [
import('#/views/demos/access/frontend/button-control.vue'), import('#/views/demos/access/frontend/button-control.vue'),
meta: { meta: {
icon: 'mdi:button-cursor', icon: 'mdi:button-cursor',
title: $t('page.demos.access.button'), title: $t('page.demos.access.buttonControl'),
}, },
}, },
{ {
name: 'AccessFrontendTest1', name: 'AccessFrontendSuperVisible',
path: 'access-test-1', path: 'super-visible',
component: () => component: () =>
import('#/views/demos/access/frontend/access-test-1.vue'), import('#/views/demos/access/frontend/super-visible.vue'),
meta: { meta: {
authority: ['super'], authority: ['super'],
icon: 'mdi:button-cursor', icon: 'mdi:button-cursor',
title: $t('page.demos.access.access-test-1'), title: $t('page.demos.access.superVisible'),
}, },
}, },
{ {
name: 'AccessFrontendTest2', name: 'AccessFrontendAdminVisible',
path: 'access-test-2', path: 'admin-visible',
component: () => component: () =>
import('#/views/demos/access/frontend/access-test-2.vue'), import('#/views/demos/access/frontend/admin-visible.vue'),
meta: { meta: {
authority: ['admin'], authority: ['admin'],
icon: 'mdi:button-cursor', icon: 'mdi:button-cursor',
title: $t('page.demos.access.access-test-2'), title: $t('page.demos.access.adminVisible'),
}, },
}, },
{ {
name: 'AccessFrontendTest3', name: 'AccessFrontendUserVisible',
path: 'access-test-3', path: 'user-visible',
component: () => component: () =>
import('#/views/demos/access/frontend/access-test-3.vue'), import('#/views/demos/access/frontend/user-visible.vue'),
meta: { meta: {
authority: ['user'], authority: ['user'],
icon: 'mdi:button-cursor', icon: 'mdi:button-cursor',
title: $t('page.demos.access.access-test-3'), title: $t('page.demos.access.userVisible'),
}, },
}, },
], ],
...@@ -95,7 +95,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -95,7 +95,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/demos/access/backend/index.vue'), component: () => import('#/views/demos/access/backend/index.vue'),
meta: { meta: {
icon: 'mdi:cloud-key-outline', icon: 'mdi:cloud-key-outline',
title: $t('page.demos.access.backend-control'), title: $t('page.demos.access.backendControl'),
}, },
children: [ children: [
{ {
...@@ -105,7 +105,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -105,7 +105,7 @@ const routes: RouteRecordRaw[] = [
import('#/views/demos/access/frontend/index.vue'), import('#/views/demos/access/frontend/index.vue'),
meta: { meta: {
icon: 'mdi:page-previous-outline', icon: 'mdi:page-previous-outline',
title: $t('page.demos.access.page'), title: $t('page.demos.access.pageAccess'),
}, },
}, },
], ],
...@@ -209,7 +209,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -209,7 +209,7 @@ const routes: RouteRecordRaw[] = [
path: 'external-link', path: 'external-link',
meta: { meta: {
icon: 'mdi:newspaper-variant-multiple-outline', icon: 'mdi:newspaper-variant-multiple-outline',
title: $t('page.demos.outside.external-link'), title: $t('page.demos.outside.externalLink'),
}, },
redirect: '/outside/external-link/vite', redirect: '/outside/external-link/vite',
children: [ children: [
...@@ -273,7 +273,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -273,7 +273,7 @@ const routes: RouteRecordRaw[] = [
meta: { meta: {
icon: 'ic:round-menu', icon: 'ic:round-menu',
keepAlive: true, keepAlive: true,
title: $t('page.demos.nested.menu21'), title: $t('page.demos.nested.menu2_1'),
}, },
}, },
], ],
...@@ -294,7 +294,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -294,7 +294,7 @@ const routes: RouteRecordRaw[] = [
meta: { meta: {
icon: 'ic:round-menu', icon: 'ic:round-menu',
keepAlive: true, keepAlive: true,
title: $t('page.demos.nested.menu31'), title: $t('page.demos.nested.menu3_1'),
}, },
}, },
{ {
...@@ -302,7 +302,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -302,7 +302,7 @@ const routes: RouteRecordRaw[] = [
path: 'menu3-2', path: 'menu3-2',
meta: { meta: {
icon: 'ic:round-menu', icon: 'ic:round-menu',
title: $t('page.demos.nested.menu32'), title: $t('page.demos.nested.menu3_2'),
}, },
redirect: '/nested/menu3/menu3-2/menu3-2-1', redirect: '/nested/menu3/menu3-2/menu3-2-1',
children: [ children: [
...@@ -314,7 +314,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -314,7 +314,7 @@ const routes: RouteRecordRaw[] = [
meta: { meta: {
icon: 'ic:round-menu', icon: 'ic:round-menu',
keepAlive: true, keepAlive: true,
title: $t('page.demos.nested.menu321'), title: $t('page.demos.nested.menu3_2_1'),
}, },
}, },
], ],
......
...@@ -20,9 +20,9 @@ async function handleLogin(params: LoginAndRegisterParams) { ...@@ -20,9 +20,9 @@ async function handleLogin(params: LoginAndRegisterParams) {
const { userInfo } = await accessStore.authLogin(params); const { userInfo } = await accessStore.authLogin(params);
if (userInfo?.realName) { if (userInfo?.realName) {
notification.success({ notification.success({
description: `${$t('authentication.login-success-desc')}:${userInfo?.realName}`, description: `${$t('authentication.loginSuccessDesc')}:${userInfo?.realName}`,
duration: 3, duration: 3,
message: $t('authentication.login-success'), message: $t('authentication.loginSuccess'),
}); });
} }
} }
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
"sonner", "sonner",
"unplugin", "unplugin",
"vben", "vben",
"vbenjs",
"vueuse", "vueuse",
"yxxx", "yxxx",
"nuxt", "nuxt",
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-regexp": "^2.6.0", "eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-unicorn": "^54.0.0", "eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-unused-imports": "^3.2.0", "eslint-plugin-unused-imports": "^4.0.0",
"eslint-plugin-vitest": "^0.5.4", "eslint-plugin-vitest": "^0.5.4",
"eslint-plugin-vue": "^9.27.0", "eslint-plugin-vue": "^9.27.0",
"globals": "^15.8.0", "globals": "^15.8.0",
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"dependencies": { "dependencies": {
"@stylistic/stylelint-plugin": "^2.1.2", "@stylistic/stylelint-plugin": "^2.1.2",
"stylelint-config-recess-order": "^5.0.1", "stylelint-config-recess-order": "^5.0.1",
"stylelint-scss": "^6.4.0" "stylelint-scss": "^6.4.1"
}, },
"devDependencies": { "devDependencies": {
"postcss": "^8.4.39", "postcss": "^8.4.39",
......
...@@ -37,6 +37,6 @@ ...@@ -37,6 +37,6 @@
"pkg-types": "^1.1.3", "pkg-types": "^1.1.3",
"prettier": "^3.3.2", "prettier": "^3.3.2",
"rimraf": "^6.0.0", "rimraf": "^6.0.0",
"zx": "^7.2.3" "zx": "^8.1.4"
} }
} }
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
"rollup": "^4.18.1", "rollup": "^4.18.1",
"rollup-plugin-visualizer": "^5.12.0", "rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.77.7", "sass": "^1.77.7",
"unplugin-turbo-console": "^1.9.0", "unplugin-turbo-console": "^1.9.2",
"vite": "^5.3.3", "vite": "^5.3.3",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-dts": "^3.9.1", "vite-plugin-dts": "^3.9.1",
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
"publint": "vsh publint", "publint": "vsh publint",
"reinstall": "pnpm clean --del-lock && pnpm bootstrap", "reinstall": "pnpm clean --del-lock && pnpm bootstrap",
"test": "vitest", "test": "vitest",
"version": "pnpm exec changeset version && pnpm install --no-frozen-lockfile" "version": "pnpm exec changeset version && pnpm install --no-frozen-lockfile",
"update:deps": " pnpm update --latest --recursive"
}, },
"devDependencies": { "devDependencies": {
"@changesets/changelog-github": "^0.5.0", "@changesets/changelog-github": "^0.5.0",
...@@ -68,7 +69,6 @@ ...@@ -68,7 +69,6 @@
"is-ci": "^3.0.1", "is-ci": "^3.0.1",
"jsdom": "^24.1.0", "jsdom": "^24.1.0",
"rimraf": "^6.0.0", "rimraf": "^6.0.0",
"taze": "^0.14.2",
"turbo": "^2.0.6", "turbo": "^2.0.6",
"typescript": "^5.5.3", "typescript": "^5.5.3",
"unbuild": "^2.0.0", "unbuild": "^2.0.0",
...@@ -88,6 +88,12 @@ ...@@ -88,6 +88,12 @@
"clsx": "^2.1.1", "clsx": "^2.1.1",
"vue": "^3.4.31" "vue": "^3.4.31"
}, },
"peerDependencyRules": {
"allowedVersions": {
"eslint": "*",
" @typescript-eslint/eslint-plugin": "*"
}
},
"neverBuiltDependencies": [ "neverBuiltDependencies": [
"canvas", "canvas",
"node-gyp", "node-gyp",
...@@ -95,8 +101,7 @@ ...@@ -95,8 +101,7 @@
], ],
"updateConfig": { "updateConfig": {
"ignoreDependencies": [ "ignoreDependencies": [
"eslint", "eslint"
"zx"
] ]
} }
} }
......
...@@ -101,7 +101,7 @@ describe('useCoreAccessStore', () => { ...@@ -101,7 +101,7 @@ describe('useCoreAccessStore', () => {
const store = useCoreTabbarStore(); const store = useCoreTabbarStore();
store.cachedTabs.add('Home'); store.cachedTabs.add('Home');
store.cachedTabs.add('About'); store.cachedTabs.add('About');
expect(store.cachedTabs).toEqual(['Home', 'About']); expect(store.getCachedTabs).toEqual(['Home', 'About']);
}); });
it('returns all tabs, including affix tabs', () => { it('returns all tabs, including affix tabs', () => {
......
...@@ -28,10 +28,11 @@ async function setupI18n(app: App, options: LocaleSetupOptions = {}) { ...@@ -28,10 +28,11 @@ async function setupI18n(app: App, options: LocaleSetupOptions = {}) {
// 在控制台打印警告 // 在控制台打印警告
i18n.global.setMissingHandler((locale, key) => { i18n.global.setMissingHandler((locale, key) => {
options.missingWarn && if (options.missingWarn && key.includes('.')) {
console.warn( console.warn(
`[intlify] Not found '${key}' key in '${locale}' locale messages.`, `[intlify] Not found '${key}' key in '${locale}' locale messages.`,
); );
}
}); });
} }
......
...@@ -37,6 +37,6 @@ ...@@ -37,6 +37,6 @@
}, },
"dependencies": { "dependencies": {
"@ant-design/colors": "^7.1.0", "@ant-design/colors": "^7.1.0",
"@ctrl/tinycolor": "4.1.0" "@ctrl/tinycolor": "^4.1.0"
} }
} }
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
}, },
"dependencies": { "dependencies": {
"@vue/shared": "^3.4.31", "@vue/shared": "^3.4.31",
"clsx": "2.1.1", "clsx": "^2.1.1",
"defu": "^6.1.4", "defu": "^6.1.4",
"lodash.clonedeep": "^4.5.0", "lodash.clonedeep": "^4.5.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
......
...@@ -49,10 +49,10 @@ const appName = computed(() => preferences.app.name); ...@@ -49,10 +49,10 @@ const appName = computed(() => preferences.app.name);
<div class="flex-col-center -enter-x mr-20 h-full"> <div class="flex-col-center -enter-x mr-20 h-full">
<SloganIcon :alt="appName" class="animate-float h-64 w-2/5" /> <SloganIcon :alt="appName" class="animate-float h-64 w-2/5" />
<div class="text-1xl mt-6 font-sans text-white lg:text-2xl"> <div class="text-1xl mt-6 font-sans text-white lg:text-2xl">
{{ $t('authentication.page-title') }} {{ $t('authentication.pageTitle') }}
</div> </div>
<div class="dark:text-muted-foreground mt-2 text-white/60"> <div class="dark:text-muted-foreground mt-2 text-white/60">
{{ $t('authentication.page-desc') }} {{ $t('authentication.pageDesc') }}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -117,7 +117,7 @@ function useTabs() { ...@@ -117,7 +117,7 @@ function useTabs() {
}, },
icon: IcRoundRefresh, icon: IcRoundRefresh,
key: 'reload', key: 'reload',
text: $t('preferences.tabbar.context-menu.reload'), text: $t('preferences.tabbar.contextMenu.reload'),
}, },
{ {
disabled: !!affixTab || disabled, disabled: !!affixTab || disabled,
...@@ -126,7 +126,7 @@ function useTabs() { ...@@ -126,7 +126,7 @@ function useTabs() {
}, },
icon: IcRoundClose, icon: IcRoundClose,
key: 'close', key: 'close',
text: $t('preferences.tabbar.context-menu.close'), text: $t('preferences.tabbar.contextMenu.close'),
}, },
{ {
handler: async () => { handler: async () => {
...@@ -138,8 +138,8 @@ function useTabs() { ...@@ -138,8 +138,8 @@ function useTabs() {
key: 'affix', key: 'affix',
separator: true, separator: true,
text: affixTab text: affixTab
? $t('preferences.tabbar.context-menu.unpin') ? $t('preferences.tabbar.contextMenu.unpin')
: $t('preferences.tabbar.context-menu.pin'), : $t('preferences.tabbar.contextMenu.pin'),
}, },
{ {
disabled: closeLeftDisabled, disabled: closeLeftDisabled,
...@@ -148,7 +148,7 @@ function useTabs() { ...@@ -148,7 +148,7 @@ function useTabs() {
}, },
icon: MdiFormatHorizontalAlignLeft, icon: MdiFormatHorizontalAlignLeft,
key: 'close-left', key: 'close-left',
text: $t('preferences.tabbar.context-menu.close-left'), text: $t('preferences.tabbar.contextMenu.closeLeft'),
}, },
{ {
disabled: closeRightDisabled, disabled: closeRightDisabled,
...@@ -158,7 +158,7 @@ function useTabs() { ...@@ -158,7 +158,7 @@ function useTabs() {
icon: MdiFormatHorizontalAlignRight, icon: MdiFormatHorizontalAlignRight,
key: 'close-right', key: 'close-right',
separator: true, separator: true,
text: $t('preferences.tabbar.context-menu.close-right'), text: $t('preferences.tabbar.contextMenu.closeRight'),
}, },
{ {
disabled: closeOtherDisabled, disabled: closeOtherDisabled,
...@@ -167,7 +167,7 @@ function useTabs() { ...@@ -167,7 +167,7 @@ function useTabs() {
}, },
icon: MdiArrowExpandHorizontal, icon: MdiArrowExpandHorizontal,
key: 'close-other', key: 'close-other',
text: $t('preferences.tabbar.context-menu.close-other'), text: $t('preferences.tabbar.contextMenu.closeOther'),
}, },
{ {
disabled, disabled,
...@@ -176,7 +176,7 @@ function useTabs() { ...@@ -176,7 +176,7 @@ function useTabs() {
}, },
icon: IcRoundMultipleStop, icon: IcRoundMultipleStop,
key: 'close-all', key: 'close-all',
text: $t('preferences.tabbar.context-menu.close-all'), text: $t('preferences.tabbar.contextMenu.closeAll'),
}, },
// { // {
// icon: 'icon-[material-symbols--back-to-tab-sharp]', // icon: 'icon-[material-symbols--back-to-tab-sharp]',
......
...@@ -116,7 +116,7 @@ onMounted(() => { ...@@ -116,7 +116,7 @@ onMounted(() => {
<IcRoundSearch class="mt-1 size-4" /> <IcRoundSearch class="mt-1 size-4" />
<input <input
v-model="keyword" v-model="keyword"
:placeholder="$t('widgets.search.search-navigate')" :placeholder="$t('widgets.search.searchNavigate')"
class="ring-none placeholder:text-muted-foreground w-[80%] rounded-md border border-none bg-transparent p-2 text-sm outline-none ring-0 ring-offset-transparent focus-visible:ring-transparent" class="ring-none placeholder:text-muted-foreground w-[80%] rounded-md border border-none bg-transparent p-2 text-sm outline-none ring-0 ring-offset-transparent focus-visible:ring-transparent"
/> />
</DialogTitle> </DialogTitle>
......
...@@ -223,7 +223,7 @@ onMounted(() => { ...@@ -223,7 +223,7 @@ onMounted(() => {
> >
<IcRoundSearchOff class="size-12" /> <IcRoundSearchOff class="size-12" />
<p class="my-10 text-xs"> <p class="my-10 text-xs">
{{ $t('widgets.search.no-results') }} {{ $t('widgets.search.noResults') }}
<span class="text-foreground text-sm font-medium"> <span class="text-foreground text-sm font-medium">
"{{ keyword }}" "{{ keyword }}"
</span> </span>
...@@ -235,7 +235,7 @@ onMounted(() => { ...@@ -235,7 +235,7 @@ onMounted(() => {
class="text-muted-foreground text-center" class="text-muted-foreground text-center"
> >
<p class="my-10 text-xs"> <p class="my-10 text-xs">
{{ $t('widgets.search.no-recent') }} {{ $t('widgets.search.noRecent') }}
</p> </p>
</div> </div>
......
...@@ -21,7 +21,7 @@ const menus = computed((): VbenDropdownMenuItem[] => [ ...@@ -21,7 +21,7 @@ const menus = computed((): VbenDropdownMenuItem[] => [
{ {
icon: MdiDockLeft, icon: MdiDockLeft,
key: 'panel-left', key: 'panel-left',
text: $t('authentication.layout.align-left'), text: $t('authentication.layout.alignLeft'),
}, },
{ {
icon: MdiDockBottom, icon: MdiDockBottom,
...@@ -31,7 +31,7 @@ const menus = computed((): VbenDropdownMenuItem[] => [ ...@@ -31,7 +31,7 @@ const menus = computed((): VbenDropdownMenuItem[] => [
{ {
icon: MdiDockRight, icon: MdiDockRight,
key: 'panel-right', key: 'panel-right',
text: $t('authentication.layout.align-right'), text: $t('authentication.layout.alignRight'),
}, },
]); ]);
......
...@@ -84,7 +84,7 @@ function handleClick(item: NotificationItem) { ...@@ -84,7 +84,7 @@ function handleClick(item: NotificationItem) {
<div class="flex items-center justify-between p-4 py-3"> <div class="flex items-center justify-between p-4 py-3">
<div class="text-foreground">{{ $t('widgets.notifications') }}</div> <div class="text-foreground">{{ $t('widgets.notifications') }}</div>
<VbenIconButton <VbenIconButton
:tooltip="$t('widgets.make-all-as-read')" :tooltip="$t('widgets.markAllAsRead')"
@click="handleMakeAll" @click="handleMakeAll"
> >
<IcRoundMarkEmailRead /> <IcRoundMarkEmailRead />
...@@ -127,7 +127,7 @@ function handleClick(item: NotificationItem) { ...@@ -127,7 +127,7 @@ function handleClick(item: NotificationItem) {
<template v-else> <template v-else>
<div class="flex-center text-muted-foreground min-h-[150px] w-full"> <div class="flex-center text-muted-foreground min-h-[150px] w-full">
{{ $t('common.not-data') }} {{ $t('common.noData') }}
</div> </div>
</template> </template>
...@@ -135,10 +135,10 @@ function handleClick(item: NotificationItem) { ...@@ -135,10 +135,10 @@ function handleClick(item: NotificationItem) {
class="border-border flex items-center justify-between border-t px-4 py-3" class="border-border flex items-center justify-between border-t px-4 py-3"
> >
<VbenButton size="sm" variant="ghost" @click="handleClear"> <VbenButton size="sm" variant="ghost" @click="handleClear">
{{ $t('widgets.clear-notifications') }} {{ $t('widgets.clearNotifications') }}
</VbenButton> </VbenButton>
<VbenButton size="sm" @click="handleViewAll"> <VbenButton size="sm" @click="handleViewAll">
{{ $t('widgets.view-all') }} {{ $t('widgets.viewAll') }}
</VbenButton> </VbenButton>
</div> </div>
</div> </div>
......
...@@ -25,6 +25,6 @@ const localeItems: SelectListItem[] = SUPPORT_LANGUAGES.map((item) => ({ ...@@ -25,6 +25,6 @@ const localeItems: SelectListItem[] = SUPPORT_LANGUAGES.map((item) => ({
{{ $t('preferences.language') }} {{ $t('preferences.language') }}
</SelectItem> </SelectItem>
<SwitchItem v-model="appDynamicTitle"> <SwitchItem v-model="appDynamicTitle">
{{ $t('preferences.dynamic-title') }} {{ $t('preferences.dynamicTitle') }}
</SwitchItem> </SwitchItem>
</template> </template>
...@@ -35,7 +35,7 @@ const disableItem = computed(() => { ...@@ -35,7 +35,7 @@ const disableItem = computed(() => {
{{ $t('preferences.breadcrumb.enable') }} {{ $t('preferences.breadcrumb.enable') }}
</SwitchItem> </SwitchItem>
<SwitchItem v-model="breadcrumbHideOnlyOne" :disabled="disableItem"> <SwitchItem v-model="breadcrumbHideOnlyOne" :disabled="disableItem">
{{ $t('preferences.breadcrumb.hide-only-one') }} {{ $t('preferences.breadcrumb.hideOnlyOne') }}
</SwitchItem> </SwitchItem>
<SwitchItem v-model="breadcrumbShowIcon" :disabled="disableItem"> <SwitchItem v-model="breadcrumbShowIcon" :disabled="disableItem">
{{ $t('preferences.breadcrumb.icon') }} {{ $t('preferences.breadcrumb.icon') }}
......
...@@ -30,10 +30,10 @@ const itemDisabled = computed(() => props.disabled || !copyrightEnable.value); ...@@ -30,10 +30,10 @@ const itemDisabled = computed(() => props.disabled || !copyrightEnable.value);
</SwitchItem> </SwitchItem>
<InputItem v-model="copyrightCompanyName" :disabled="itemDisabled"> <InputItem v-model="copyrightCompanyName" :disabled="itemDisabled">
{{ $t('preferences.copyright.company-name') }} {{ $t('preferences.copyright.companyName') }}
</InputItem> </InputItem>
<InputItem v-model="copyrightCompanySiteLink" :disabled="itemDisabled"> <InputItem v-model="copyrightCompanySiteLink" :disabled="itemDisabled">
{{ $t('preferences.copyright.company-site-link') }} {{ $t('preferences.copyright.companySiteLink') }}
</InputItem> </InputItem>
<InputItem v-model="copyrightDate" :disabled="itemDisabled"> <InputItem v-model="copyrightDate" :disabled="itemDisabled">
{{ $t('preferences.copyright.date') }} {{ $t('preferences.copyright.date') }}
...@@ -43,6 +43,6 @@ const itemDisabled = computed(() => props.disabled || !copyrightEnable.value); ...@@ -43,6 +43,6 @@ const itemDisabled = computed(() => props.disabled || !copyrightEnable.value);
{{ $t('preferences.copyright.icp') }} {{ $t('preferences.copyright.icp') }}
</InputItem> </InputItem>
<InputItem v-model="copyrightIcpLink" :disabled="itemDisabled"> <InputItem v-model="copyrightIcpLink" :disabled="itemDisabled">
{{ $t('preferences.copyright.icp-link') }} {{ $t('preferences.copyright.icpLink') }}
</InputItem> </InputItem>
</template> </template>
...@@ -17,19 +17,19 @@ const headerMode = defineModel<LayoutHeaderModeType>('headerMode'); ...@@ -17,19 +17,19 @@ const headerMode = defineModel<LayoutHeaderModeType>('headerMode');
const localeItems: SelectListItem[] = [ const localeItems: SelectListItem[] = [
{ {
label: $t('preferences.header.mode-static'), label: $t('preferences.header.modeStatic'),
value: 'static', value: 'static',
}, },
{ {
label: $t('preferences.header.mode-fixed'), label: $t('preferences.header.modeFixed'),
value: 'fixed', value: 'fixed',
}, },
{ {
label: $t('preferences.header.mode-auto'), label: $t('preferences.header.modeAuto'),
value: 'auto', value: 'auto',
}, },
{ {
label: $t('preferences.header.mode-auto-scroll'), label: $t('preferences.header.modeAutoScroll'),
value: 'auto-scroll', value: 'auto-scroll',
}, },
]; ];
......
...@@ -38,27 +38,27 @@ const components: Record<LayoutType, Component> = { ...@@ -38,27 +38,27 @@ const components: Record<LayoutType, Component> = {
const PRESET = computed((): PresetItem[] => [ const PRESET = computed((): PresetItem[] => [
{ {
name: $t('preferences.vertical'), name: $t('preferences.vertical'),
tip: $t('preferences.vertical-tip'), tip: $t('preferences.verticalTip'),
type: 'sidebar-nav', type: 'sidebar-nav',
}, },
{ {
name: $t('preferences.two-column'), name: $t('preferences.twoColumn'),
tip: $t('preferences.two-column-tip'), tip: $t('preferences.twoColumnTip'),
type: 'sidebar-mixed-nav', type: 'sidebar-mixed-nav',
}, },
{ {
name: $t('preferences.horizontal'), name: $t('preferences.horizontal'),
tip: $t('preferences.vertical-tip'), tip: $t('preferences.horizontalTip'),
type: 'header-nav', type: 'header-nav',
}, },
{ {
name: $t('preferences.mixed-menu'), name: $t('preferences.mixedMenu'),
tip: $t('preferences.mixed-menu-tip'), tip: $t('preferences.mixedMenuTip'),
type: 'mixed-nav', type: 'mixed-nav',
}, },
{ {
name: $t('preferences.full-content'), name: $t('preferences.fullContent'),
tip: $t('preferences.full-content-tip'), tip: $t('preferences.fullContentTip'),
type: 'full-content', type: 'full-content',
}, },
]); ]);
......
...@@ -28,18 +28,18 @@ const stylesItems: SelectListItem[] = [ ...@@ -28,18 +28,18 @@ const stylesItems: SelectListItem[] = [
:disabled="disabled" :disabled="disabled"
:items="stylesItems" :items="stylesItems"
> >
{{ $t('preferences.navigation-menu.style') }} {{ $t('preferences.navigationMenu.style') }}
</ToggleItem> </ToggleItem>
<SwitchItem <SwitchItem
v-model="navigationSplit" v-model="navigationSplit"
:disabled="disabledNavigationSplit || disabled" :disabled="disabledNavigationSplit || disabled"
> >
{{ $t('preferences.navigation-menu.split') }} {{ $t('preferences.navigationMenu.split') }}
<template #tip> <template #tip>
{{ $t('preferences.navigation-menu.split-tip') }} {{ $t('preferences.navigationMenu.splitTip') }}
</template> </template>
</SwitchItem> </SwitchItem>
<SwitchItem v-model="navigationAccordion" :disabled="disabled"> <SwitchItem v-model="navigationAccordion" :disabled="disabled">
{{ $t('preferences.navigation-menu.accordion') }} {{ $t('preferences.navigationMenu.accordion') }}
</SwitchItem> </SwitchItem>
</template> </template>
...@@ -29,7 +29,7 @@ const sidebarCollapsed = defineModel<boolean>('sidebarCollapsed'); ...@@ -29,7 +29,7 @@ const sidebarCollapsed = defineModel<boolean>('sidebarCollapsed');
v-model="sidebarCollapsedShowTitle" v-model="sidebarCollapsedShowTitle"
:disabled="!sidebarEnable || disabled" :disabled="!sidebarEnable || disabled"
> >
{{ $t('preferences.sidebar.collapsed-show-title') }} {{ $t('preferences.sidebar.collapsedShowTitle') }}
</SwitchItem> </SwitchItem>
<NumberFieldItem <NumberFieldItem
v-model="sidebarWidth" v-model="sidebarWidth"
......
...@@ -18,13 +18,13 @@ const widgetSidebarToggle = defineModel<boolean>('widgetSidebarToggle'); ...@@ -18,13 +18,13 @@ const widgetSidebarToggle = defineModel<boolean>('widgetSidebarToggle');
<template> <template>
<SwitchItem v-model="widgetGlobalSearch"> <SwitchItem v-model="widgetGlobalSearch">
{{ $t('preferences.widget.global-search') }} {{ $t('preferences.widget.globalSearch') }}
</SwitchItem> </SwitchItem>
<SwitchItem v-model="widgetThemeToggle"> <SwitchItem v-model="widgetThemeToggle">
{{ $t('preferences.widget.theme-toggle') }} {{ $t('preferences.widget.themeToggle') }}
</SwitchItem> </SwitchItem>
<SwitchItem v-model="widgetLanguageToggle"> <SwitchItem v-model="widgetLanguageToggle">
{{ $t('preferences.widget.language-toggle') }} {{ $t('preferences.widget.languageToggle') }}
</SwitchItem> </SwitchItem>
<SwitchItem v-model="widgetFullscreen"> <SwitchItem v-model="widgetFullscreen">
{{ $t('preferences.widget.fullscreen') }} {{ $t('preferences.widget.fullscreen') }}
...@@ -33,9 +33,9 @@ const widgetSidebarToggle = defineModel<boolean>('widgetSidebarToggle'); ...@@ -33,9 +33,9 @@ const widgetSidebarToggle = defineModel<boolean>('widgetSidebarToggle');
{{ $t('preferences.widget.notification') }} {{ $t('preferences.widget.notification') }}
</SwitchItem> </SwitchItem>
<SwitchItem v-model="widgetAiAssistant"> <SwitchItem v-model="widgetAiAssistant">
{{ $t('preferences.widget.ai-assistant') }} {{ $t('preferences.widget.aiAssistant') }}
</SwitchItem> </SwitchItem>
<SwitchItem v-model="widgetSidebarToggle"> <SwitchItem v-model="widgetSidebarToggle">
{{ $t('preferences.widget.sidebar-toggle') }} {{ $t('preferences.widget.sidebarToggle') }}
</SwitchItem> </SwitchItem>
</template> </template>
...@@ -22,21 +22,21 @@ const altView = computed(() => (isWindowsOs() ? 'Alt' : '⌥')); ...@@ -22,21 +22,21 @@ const altView = computed(() => (isWindowsOs() ? 'Alt' : '⌥'));
<template> <template>
<SwitchItem v-model="shortcutKeysEnable"> <SwitchItem v-model="shortcutKeysEnable">
{{ $t('preferences.shortcut-keys.title') }} {{ $t('preferences.shortcutKeys.title') }}
</SwitchItem> </SwitchItem>
<SwitchItem v-if="shortcutKeysEnable" v-model="shortcutKeysGlobalSearch"> <SwitchItem v-if="shortcutKeysEnable" v-model="shortcutKeysGlobalSearch">
{{ $t('preferences.shortcut-keys.search') }} {{ $t('preferences.shortcutKeys.search') }}
<template #shortcut> <template #shortcut>
{{ isWindowsOs() ? 'Ctrl' : '⌘' }} {{ isWindowsOs() ? 'Ctrl' : '⌘' }}
<kbd> K </kbd> <kbd> K </kbd>
</template> </template>
</SwitchItem> </SwitchItem>
<SwitchItem v-if="shortcutKeysEnable" v-model="shortcutKeysLogout"> <SwitchItem v-if="shortcutKeysEnable" v-model="shortcutKeysLogout">
{{ $t('preferences.shortcut-keys.logout') }} {{ $t('preferences.shortcutKeys.logout') }}
<template #shortcut> {{ altView }} Q </template> <template #shortcut> {{ altView }} Q </template>
</SwitchItem> </SwitchItem>
<SwitchItem v-if="shortcutKeysEnable" v-model="shortcutKeysPreferences"> <SwitchItem v-if="shortcutKeysEnable" v-model="shortcutKeysPreferences">
{{ $t('preferences.shortcut-keys.preferences') }} {{ $t('preferences.shortcutKeys.preferences') }}
<template #shortcut> {{ altView }} , </template> <template #shortcut> {{ altView }} , </template>
</SwitchItem> </SwitchItem>
</template> </template>
...@@ -40,17 +40,17 @@ function typeView(name: BuiltinThemeType) { ...@@ -40,17 +40,17 @@ function typeView(name: BuiltinThemeType) {
return $t('preferences.theme.builtin.rose'); return $t('preferences.theme.builtin.rose');
} }
case 'sky-blue': { case 'sky-blue': {
return $t('preferences.theme.builtin.sky-blue'); return $t('preferences.theme.builtin.skyBlue');
} }
case 'deep-blue': { case 'deep-blue': {
return $t('preferences.theme.builtin.deep-blue'); return $t('preferences.theme.builtin.deepBlue');
} }
case 'green': { case 'green': {
return $t('preferences.theme.builtin.green'); return $t('preferences.theme.builtin.green');
} }
case 'deep-green': { case 'deep-green': {
return $t('preferences.theme.builtin.deep-green'); return $t('preferences.theme.builtin.deepGreen');
} }
case 'orange': { case 'orange': {
return $t('preferences.theme.builtin.orange'); return $t('preferences.theme.builtin.orange');
......
...@@ -18,9 +18,9 @@ const appColorGrayMode = defineModel<boolean>('appColorGrayMode', { ...@@ -18,9 +18,9 @@ const appColorGrayMode = defineModel<boolean>('appColorGrayMode', {
<template> <template>
<SwitchItem v-model="appColorWeakMode"> <SwitchItem v-model="appColorWeakMode">
{{ $t('preferences.theme.weak-mode') }} {{ $t('preferences.theme.weakMode') }}
</SwitchItem> </SwitchItem>
<SwitchItem v-model="appColorGrayMode"> <SwitchItem v-model="appColorGrayMode">
{{ $t('preferences.theme.gray-mode') }} {{ $t('preferences.theme.grayMode') }}
</SwitchItem> </SwitchItem>
</template> </template>
...@@ -49,7 +49,7 @@ function nameView(name: string) { ...@@ -49,7 +49,7 @@ function nameView(name: string) {
return $t('preferences.theme.dark'); return $t('preferences.theme.dark');
} }
case 'auto': { case 'auto': {
return $t('preferences.follow-system'); return $t('preferences.followSystem');
} }
} }
} }
...@@ -79,7 +79,7 @@ function nameView(name: string) { ...@@ -79,7 +79,7 @@ function nameView(name: string) {
:disabled="modelValue !== 'light'" :disabled="modelValue !== 'light'"
class="mt-6" class="mt-6"
> >
{{ $t('preferences.theme.dark-menu') }} {{ $t('preferences.theme.darkMenu') }}
</SwitchItem> </SwitchItem>
</div> </div>
</template> </template>
...@@ -162,7 +162,7 @@ const tabs = computed((): SegmentedItem[] => { ...@@ -162,7 +162,7 @@ const tabs = computed((): SegmentedItem[] => {
value: 'layout', value: 'layout',
}, },
{ {
label: $t('preferences.shortcut-keys.title'), label: $t('preferences.shortcutKeys.title'),
value: 'shortcutKey', value: 'shortcutKey',
}, },
{ {
...@@ -187,8 +187,8 @@ async function handleCopy() { ...@@ -187,8 +187,8 @@ async function handleCopy() {
await copy(JSON.stringify(diffPreference.value, null, 2)); await copy(JSON.stringify(diffPreference.value, null, 2));
toast({ toast({
description: $t('preferences.copy'), description: $t('preferences.copyPreferences'),
title: $t('preferences.copy-success'), title: $t('preferences.copyPreferencesSuccess'),
}); });
} }
...@@ -205,12 +205,8 @@ async function handleReset() { ...@@ -205,12 +205,8 @@ async function handleReset() {
resetPreferences(); resetPreferences();
await loadLocaleMessages(preferences.app.locale); await loadLocaleMessages(preferences.app.locale);
toast({ toast({
description: $t('preferences.reset-title'), description: $t('preferences.resetTitle'),
title: $t('preferences.reset-success'), title: $t('preferences.resetSuccess'),
});
toast({
description: $t('preferences.reset-title'),
title: $t('preferences.reset-success'),
}); });
} }
</script> </script>
...@@ -236,7 +232,7 @@ async function handleReset() { ...@@ -236,7 +232,7 @@ async function handleReset() {
<div class="flex items-center"> <div class="flex items-center">
<VbenIconButton <VbenIconButton
:disabled="!diffPreference" :disabled="!diffPreference"
:tooltip="$t('preferences.reset-tip')" :tooltip="$t('preferences.resetTip')"
class="relative" class="relative"
> >
<span <span
...@@ -323,7 +319,7 @@ async function handleReset() { ...@@ -323,7 +319,7 @@ async function handleReset() {
/> />
</Block> </Block>
<Block :title="$t('preferences.navigation-menu.title')"> <Block :title="$t('preferences.navigationMenu.title')">
<Navigation <Navigation
v-model:navigation-accordion="navigationAccordion" v-model:navigation-accordion="navigationAccordion"
v-model:navigation-split="navigationSplit" v-model:navigation-split="navigationSplit"
...@@ -384,7 +380,7 @@ async function handleReset() { ...@@ -384,7 +380,7 @@ async function handleReset() {
</template> </template>
<template #shortcutKey> <template #shortcutKey>
<Block :title="$t('preferences.shortcut-keys.global')"> <Block :title="$t('preferences.shortcutKeys.global')">
<GlobalShortcutKeys <GlobalShortcutKeys
v-model:shortcut-keys-enable="shortcutKeysEnable" v-model:shortcut-keys-enable="shortcutKeysEnable"
v-model:shortcut-keys-global-search="shortcutKeysGlobalSearch" v-model:shortcut-keys-global-search="shortcutKeysGlobalSearch"
...@@ -407,7 +403,7 @@ async function handleReset() { ...@@ -407,7 +403,7 @@ async function handleReset() {
@click="handleClearCache" @click="handleClearCache"
> >
<IcRoundRestartAlt class="mr-2 size-4" /> <IcRoundRestartAlt class="mr-2 size-4" />
{{ $t('preferences.clear-and-logout') }} {{ $t('preferences.clearAndLogout') }}
</VbenButton> </VbenButton>
<VbenButton <VbenButton
:disabled="!diffPreference" :disabled="!diffPreference"
...@@ -417,7 +413,7 @@ async function handleReset() { ...@@ -417,7 +413,7 @@ async function handleReset() {
@click="handleCopy" @click="handleCopy"
> >
<IcRoundFolderCopy class="mr-2 size-3" /> <IcRoundFolderCopy class="mr-2 size-3" />
{{ $t('preferences.copy') }} {{ $t('preferences.copyPreferences') }}
</VbenButton> </VbenButton>
</template> </template>
</VbenSheet> </VbenSheet>
......
...@@ -49,7 +49,7 @@ const PRESETS = [ ...@@ -49,7 +49,7 @@ const PRESETS = [
{ {
icon: IcRoundMotionPhotosAuto, icon: IcRoundMotionPhotosAuto,
name: 'auto', name: 'auto',
title: $t('preferences.follow-system'), title: $t('preferences.followSystem'),
}, },
]; ];
</script> </script>
......
...@@ -121,7 +121,7 @@ if (enableShortcutKey.value) { ...@@ -121,7 +121,7 @@ if (enableShortcutKey.value) {
<VbenAlertDialog <VbenAlertDialog
v-model:open="openDialog" v-model:open="openDialog"
:cancel-text="$t('common.cancel')" :cancel-text="$t('common.cancel')"
:content="$t('widgets.logout-tip')" :content="$t('widgets.logoutTip')"
:submit-text="$t('common.confirm')" :submit-text="$t('common.confirm')"
:title="$t('common.prompt')" :title="$t('common.prompt')"
@submit="handleSubmitLogout" @submit="handleSubmitLogout"
......
...@@ -52,8 +52,8 @@ const isValidPhoneNumber = computed(() => { ...@@ -52,8 +52,8 @@ const isValidPhoneNumber = computed(() => {
const btnText = computed(() => { const btnText = computed(() => {
return countdown.value > 0 return countdown.value > 0
? $t('authentication.send-text', [countdown.value]) ? $t('authentication.sendText', [countdown.value])
: $t('authentication.send-code'); : $t('authentication.sendCode');
}); });
const btnLoading = computed(() => { const btnLoading = computed(() => {
return countdown.value > 0; return countdown.value > 0;
...@@ -117,10 +117,10 @@ onBeforeUnmount(() => { ...@@ -117,10 +117,10 @@ onBeforeUnmount(() => {
<template> <template>
<div> <div>
<Title> <Title>
{{ $t('authentication.welcome-back') }} 📲 {{ $t('authentication.welcomeBack') }} 📲
<template #desc> <template #desc>
<span class="text-muted-foreground"> <span class="text-muted-foreground">
{{ $t('authentication.code-subtitle') }} {{ $t('authentication.codeSubtitle') }}
</span> </span>
</template> </template>
</Title> </Title>
...@@ -140,7 +140,7 @@ onBeforeUnmount(() => { ...@@ -140,7 +140,7 @@ onBeforeUnmount(() => {
:btn-loading="btnLoading" :btn-loading="btnLoading"
:btn-text="btnText" :btn-text="btnText"
:code-length="4" :code-length="4"
:error-tip="$t('authentication.code-tip')" :error-tip="$t('authentication.codeTip')"
:handle-send-code="handleSendCode" :handle-send-code="handleSendCode"
:label="$t('authentication.code')" :label="$t('authentication.code')"
:placeholder="$t('authentication.code')" :placeholder="$t('authentication.code')"
......
...@@ -58,15 +58,15 @@ function goLogin() { ...@@ -58,15 +58,15 @@ function goLogin() {
<template> <template>
<div> <div>
<Title> <Title>
{{ $t('authentication.forget-password') }} 🤦🏻‍♂️ {{ $t('authentication.forgetPassword') }} 🤦🏻‍♂️
<template #desc> <template #desc>
{{ $t('authentication.forget-password-subtitle') }} {{ $t('authentication.forgetPasswordSubtitle') }}
</template> </template>
</Title> </Title>
<div class="mb-6"> <div class="mb-6">
<VbenInput <VbenInput
v-model="formState.email" v-model="formState.email"
:error-tip="$t('authentication.email-tip')" :error-tip="$t('authentication.emailTip')"
:label="$t('authentication.email')" :label="$t('authentication.email')"
:status="emailStatus" :status="emailStatus"
autofocus autofocus
...@@ -77,7 +77,7 @@ function goLogin() { ...@@ -77,7 +77,7 @@ function goLogin() {
</div> </div>
<div> <div>
<VbenButton class="mt-2 w-full" @click="handleSubmut"> <VbenButton class="mt-2 w-full" @click="handleSubmut">
{{ $t('authentication.send-reset-link') }} {{ $t('authentication.sendResetLink') }}
</VbenButton> </VbenButton>
<VbenButton class="mt-4 w-full" variant="outline" @click="goLogin()"> <VbenButton class="mt-4 w-full" variant="outline" @click="goLogin()">
{{ $t('common.back') }} {{ $t('common.back') }}
......
...@@ -150,10 +150,10 @@ function handleGo(path: string) { ...@@ -150,10 +150,10 @@ function handleGo(path: string) {
<template> <template>
<div @keypress.enter.prevent="handleSubmit"> <div @keypress.enter.prevent="handleSubmit">
<Title> <Title>
{{ $t('authentication.welcome-back') }} 👋🏻 {{ $t('authentication.welcomeBack') }} 👋🏻
<template #desc> <template #desc>
<span class="text-muted-foreground"> <span class="text-muted-foreground">
{{ $t('authentication.login-subtitle') }} {{ $t('authentication.loginSubtitle') }}
</span> </span>
</template> </template>
</Title> </Title>
...@@ -161,7 +161,7 @@ function handleGo(path: string) { ...@@ -161,7 +161,7 @@ function handleGo(path: string) {
<VbenInput <VbenInput
v-model="formState.username" v-model="formState.username"
:autofocus="false" :autofocus="false"
:error-tip="$t('authentication.username-tip')" :error-tip="$t('authentication.usernameTip')"
:label="$t('authentication.username')" :label="$t('authentication.username')"
:placeholder="usernamePlaceholder || $t('authentication.username')" :placeholder="usernamePlaceholder || $t('authentication.username')"
:status="usernameStatus" :status="usernameStatus"
...@@ -171,7 +171,7 @@ function handleGo(path: string) { ...@@ -171,7 +171,7 @@ function handleGo(path: string) {
/> />
<VbenInputPassword <VbenInputPassword
v-model="formState.password" v-model="formState.password"
:error-tip="$t('authentication.password-tip')" :error-tip="$t('authentication.passwordTip')"
:label="$t('authentication.password')" :label="$t('authentication.password')"
:placeholder="passwordPlaceholder || $t('authentication.password')" :placeholder="passwordPlaceholder || $t('authentication.password')"
:status="passwordStatus" :status="passwordStatus"
...@@ -183,7 +183,7 @@ function handleGo(path: string) { ...@@ -183,7 +183,7 @@ function handleGo(path: string) {
<div class="mb-6 mt-4 flex justify-between"> <div class="mb-6 mt-4 flex justify-between">
<div class="flex-center flex"> <div class="flex-center flex">
<VbenCheckbox v-model:checked="formState.rememberMe" name="rememberMe"> <VbenCheckbox v-model:checked="formState.rememberMe" name="rememberMe">
{{ $t('authentication.remember-me') }} {{ $t('authentication.rememberMe') }}
</VbenCheckbox> </VbenCheckbox>
</div> </div>
...@@ -192,7 +192,7 @@ function handleGo(path: string) { ...@@ -192,7 +192,7 @@ function handleGo(path: string) {
class="text-primary hover:text-primary-hover active:text-primary-active cursor-pointer text-sm font-normal" class="text-primary hover:text-primary-hover active:text-primary-active cursor-pointer text-sm font-normal"
@click="handleGo(forgetPasswordPath)" @click="handleGo(forgetPasswordPath)"
> >
{{ $t('authentication.forget-password') }} {{ $t('authentication.forgetPassword') }}
</span> </span>
<!-- <VbenButton variant="ghost" @click="handleGo('/auth/forget-password')"> <!-- <VbenButton variant="ghost" @click="handleGo('/auth/forget-password')">
...@@ -210,7 +210,7 @@ function handleGo(path: string) { ...@@ -210,7 +210,7 @@ function handleGo(path: string) {
variant="outline" variant="outline"
@click="handleGo(codeLoginPath)" @click="handleGo(codeLoginPath)"
> >
{{ $t('authentication.mobile-login') }} {{ $t('authentication.mobileLogin') }}
</VbenButton> </VbenButton>
<VbenButton <VbenButton
v-if="showQrcodeLogin" v-if="showQrcodeLogin"
...@@ -218,7 +218,7 @@ function handleGo(path: string) { ...@@ -218,7 +218,7 @@ function handleGo(path: string) {
variant="outline" variant="outline"
@click="handleGo(qrCodeLoginPath)" @click="handleGo(qrCodeLoginPath)"
> >
{{ $t('authentication.qrcode-login') }} {{ $t('authentication.qrcodeLogin') }}
</VbenButton> </VbenButton>
<!-- <VbenButton <!-- <VbenButton
:loading="loading" :loading="loading"
...@@ -234,12 +234,12 @@ function handleGo(path: string) { ...@@ -234,12 +234,12 @@ function handleGo(path: string) {
<ThirdPartyLogin v-if="showThirdPartyLogin" /> <ThirdPartyLogin v-if="showThirdPartyLogin" />
<div v-if="showRegister" class="text-center text-sm"> <div v-if="showRegister" class="text-center text-sm">
{{ $t('authentication.account-tip') }} {{ $t('authentication.accountTip') }}
<span <span
class="text-primary hover:text-primary-hover active:text-primary-active cursor-pointer text-sm font-normal" class="text-primary hover:text-primary-hover active:text-primary-active cursor-pointer text-sm font-normal"
@click="handleGo(registerPath)" @click="handleGo(registerPath)"
> >
{{ $t('authentication.create-account') }} {{ $t('authentication.createAccount') }}
</span> </span>
</div> </div>
</div> </div>
......
...@@ -47,10 +47,10 @@ function goLogin() { ...@@ -47,10 +47,10 @@ function goLogin() {
<template> <template>
<div> <div>
<Title> <Title>
{{ $t('authentication.welcome-back') }} 📱 {{ $t('authentication.welcomeBack') }} 📱
<template #desc> <template #desc>
<span class="text-muted-foreground"> <span class="text-muted-foreground">
{{ $t('authentication.qrcode-subtitle') }} {{ $t('authentication.qrcodeSubtitle') }}
</span> </span>
</template> </template>
</Title> </Title>
...@@ -58,7 +58,7 @@ function goLogin() { ...@@ -58,7 +58,7 @@ function goLogin() {
<div class="flex-col-center mt-6"> <div class="flex-col-center mt-6">
<img :src="qrcode" alt="qrcode" class="w-1/2" /> <img :src="qrcode" alt="qrcode" class="w-1/2" />
<p class="text-muted-foreground mt-4 text-sm"> <p class="text-muted-foreground mt-4 text-sm">
{{ $t('authentication.qrcode-prompt') }} {{ $t('authentication.qrcodePrompt') }}
</p> </p>
</div> </div>
......
...@@ -86,12 +86,12 @@ function goLogin() { ...@@ -86,12 +86,12 @@ function goLogin() {
<template> <template>
<div> <div>
<Title> <Title>
{{ $t('authentication.create-an-account') }} 🚀 {{ $t('authentication.createAnAccount') }} 🚀
<template #desc> {{ $t('authentication.sign-up-subtitle') }} </template> <template #desc> {{ $t('authentication.signUpSubtitle') }} </template>
</Title> </Title>
<VbenInput <VbenInput
v-model="formState.username" v-model="formState.username"
:error-tip="$t('authentication.username-tip')" :error-tip="$t('authentication.usernameTip')"
:label="$t('authentication.username')" :label="$t('authentication.username')"
:placeholder="$t('authentication.username')" :placeholder="$t('authentication.username')"
:status="usernameStatus" :status="usernameStatus"
...@@ -101,7 +101,7 @@ function goLogin() { ...@@ -101,7 +101,7 @@ function goLogin() {
<!-- Use 8 or more characters with a mix of letters, numbers & symbols. --> <!-- Use 8 or more characters with a mix of letters, numbers & symbols. -->
<VbenInputPassword <VbenInputPassword
v-model="formState.password" v-model="formState.password"
:error-tip="$t('authentication.password-tip')" :error-tip="$t('authentication.passwordTip')"
:label="$t('authentication.password')" :label="$t('authentication.password')"
:password-strength="true" :password-strength="true"
:placeholder="$t('authentication.password')" :placeholder="$t('authentication.password')"
...@@ -111,15 +111,15 @@ function goLogin() { ...@@ -111,15 +111,15 @@ function goLogin() {
type="password" type="password"
> >
<template #strengthText> <template #strengthText>
{{ $t('authentication.password-strength') }} {{ $t('authentication.passwordStrength') }}
</template> </template>
</VbenInputPassword> </VbenInputPassword>
<VbenInputPassword <VbenInputPassword
v-model="formState.comfirmPassword" v-model="formState.comfirmPassword"
:error-tip="$t('authentication.comfirm-password-tip')" :error-tip="$t('authentication.confirmPasswordTip')"
:label="$t('authentication.comfirm-password')" :label="$t('authentication.confirmPassword')"
:placeholder="$t('authentication.comfirm-password')" :placeholder="$t('authentication.confirmPassword')"
:status="comfirmPasswordStatus" :status="comfirmPasswordStatus"
name="comfirmPassword" name="comfirmPassword"
required required
...@@ -132,13 +132,13 @@ function goLogin() { ...@@ -132,13 +132,13 @@ function goLogin() {
v-model:checked="formState.agreePolicy" v-model:checked="formState.agreePolicy"
name="agreePolicy" name="agreePolicy"
> >
{{ $t('authentication.sign-up-agree') }} {{ $t('authentication.agree') }}
<span class="text-primary hover:text-primary-hover">{{ <span class="text-primary hover:text-primary-hover">{{
$t('authentication.sign-up-privacy-policy') $t('authentication.agreeprivacyPolicy')
}}</span> }}</span>
& &
<span class="text-primary hover:text-primary-hover"> <span class="text-primary hover:text-primary-hover">
{{ $t('authentication.sign-up-terms') }} {{ $t('authentication.terms') }}
</span> </span>
</VbenCheckbox> </VbenCheckbox>
</div> </div>
...@@ -147,22 +147,22 @@ function goLogin() { ...@@ -147,22 +147,22 @@ function goLogin() {
v-show="formState.submitted && !formState.agreePolicy" v-show="formState.submitted && !formState.agreePolicy"
class="text-destructive absolute bottom-1 left-0 text-xs" class="text-destructive absolute bottom-1 left-0 text-xs"
> >
{{ $t('authentication.sign-up-agree-tip') }} {{ $t('authentication.agreeTip') }}
</p> </p>
</Transition> </Transition>
</div> </div>
<div> <div>
<VbenButton :loading="loading" class="w-full" @click="handleSubmit"> <VbenButton :loading="loading" class="w-full" @click="handleSubmit">
{{ $t('authentication.sign-up') }} {{ $t('authentication.signUp') }}
</VbenButton> </VbenButton>
</div> </div>
<div class="mt-4 text-center text-sm"> <div class="mt-4 text-center text-sm">
{{ $t('authentication.already-account') }} {{ $t('authentication.alreadyHaveAccount') }}
<span <span
class="text-primary hover:text-primary-hover cursor-pointer text-sm font-normal" class="text-primary hover:text-primary-hover cursor-pointer text-sm font-normal"
@click="goLogin()" @click="goLogin()"
> >
{{ $t('authentication.go-login') }} {{ $t('authentication.goToLogin') }}
</span> </span>
</div> </div>
</div> </div>
......
...@@ -13,7 +13,7 @@ defineOptions({ ...@@ -13,7 +13,7 @@ defineOptions({
<div class="mt-4 flex items-center justify-between"> <div class="mt-4 flex items-center justify-between">
<span class="border-input w-[35%] border-b dark:border-gray-600"></span> <span class="border-input w-[35%] border-b dark:border-gray-600"></span>
<span class="text-muted-foreground text-center text-xs uppercase"> <span class="text-muted-foreground text-center text-xs uppercase">
{{ $t('authentication.third-party-login') }} {{ $t('authentication.thirdPartyLogin') }}
</span> </span>
<span class="border-input w-[35%] border-b dark:border-gray-600"></span> <span class="border-input w-[35%] border-b dark:border-gray-600"></span>
</div> </div>
......
...@@ -43,13 +43,13 @@ const titleText = computed(() => { ...@@ -43,13 +43,13 @@ const titleText = computed(() => {
return $t('fallback.forbidden'); return $t('fallback.forbidden');
} }
case '404': { case '404': {
return $t('fallback.page-not-found'); return $t('fallback.pageNotFound');
} }
case '500': { case '500': {
return $t('fallback.internal-error'); return $t('fallback.internalError');
} }
case 'offline': { case 'offline': {
return $t('fallback.offline-error'); return $t('fallback.offlineError');
} }
case 'comming-soon': { case 'comming-soon': {
return $t('fallback.coming-soon'); return $t('fallback.coming-soon');
...@@ -66,16 +66,16 @@ const descText = computed(() => { ...@@ -66,16 +66,16 @@ const descText = computed(() => {
} }
switch (props.status) { switch (props.status) {
case '403': { case '403': {
return $t('fallback.forbidden-desc'); return $t('fallback.forbiddenDesc');
} }
case '404': { case '404': {
return $t('fallback.page-not-found-desc'); return $t('fallback.pageNotFoundDesc');
} }
case '500': { case '500': {
return $t('fallback.internal-error-desc'); return $t('fallback.internalErrorDesc');
} }
case 'offline': { case 'offline': {
return $t('fallback.offline-error-desc'); return $t('fallback.offlineErrorDesc');
} }
default: { default: {
return ''; return '';
...@@ -152,7 +152,7 @@ function refresh() { ...@@ -152,7 +152,7 @@ function refresh() {
<slot v-if="$slots.action" name="action"></slot> <slot v-if="$slots.action" name="action"></slot>
<VbenButton v-else-if="showBack" size="lg" @click="back"> <VbenButton v-else-if="showBack" size="lg" @click="back">
<IcRoundArrowBackIosNew class="mr-2" /> <IcRoundArrowBackIosNew class="mr-2" />
{{ $t('common.back-to-home') }} {{ $t('common.backToHome') }}
</VbenButton> </VbenButton>
<VbenButton v-else-if="showRefresh" size="lg" @click="refresh"> <VbenButton v-else-if="showRefresh" size="lg" @click="refresh">
<IcRoundRefresh class="mr-2" /> <IcRoundRefresh class="mr-2" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!