refactor: reconstruct language files into multi-file structures (#4683)

* refactor: reconstruct language files into multi-file structures

* chore: typo
This commit is contained in:
Vben
2024-10-19 14:28:21 +08:00
committed by GitHub
parent d1ca09c7bb
commit 0df8c5c02c
93 changed files with 1707 additions and 1514 deletions

View File

@@ -41,7 +41,7 @@ const withDefaultPlaceholder = <T extends Component>(
type: 'input' | 'select',
) => {
return (props: any, { attrs, slots }: Omit<SetupContext, 'expose'>) => {
const placeholder = props?.placeholder || $t(`placeholder.${type}`);
const placeholder = props?.placeholder || $t(`ui.placeholder.${type}`);
return h(component, { ...props, ...attrs, placeholder }, slots);
};
};

View File

@@ -24,14 +24,14 @@ setupVbenForm<ComponentType>({
// 输入项目必填国际化适配
required: (value, _params, ctx) => {
if (value === undefined || value === null || value.length === 0) {
return $t('formRules.required', [ctx.label]);
return $t('ui.formRules.required', [ctx.label]);
}
return true;
},
// 选择项目必填国际化适配
selectRequired: (value, _params, ctx) => {
if (value === undefined || value === null) {
return $t('formRules.selectRequired', [ctx.label]);
return $t('ui.formRules.selectRequired', [ctx.label]);
}
return true;
},

View File

@@ -68,7 +68,7 @@ const menus = computed(() => [
});
},
icon: BookOpenText,
text: $t('widgets.document'),
text: $t('ui.widgets.document'),
},
{
handler: () => {
@@ -86,7 +86,7 @@ const menus = computed(() => [
});
},
icon: CircleHelp,
text: $t('widgets.qa'),
text: $t('ui.widgets.qa'),
},
]);

View File

@@ -4,7 +4,11 @@ import type { Locale } from 'ant-design-vue/es/locale';
import type { App } from 'vue';
import { ref } from 'vue';
import { $t, setupI18n as coreSetup, loadLocalesMap } from '@vben/locales';
import {
$t,
setupI18n as coreSetup,
loadLocalesMapFromDir,
} from '@vben/locales';
import { preferences } from '@vben/preferences';
import antdEnLocale from 'ant-design-vue/es/locale/en_US';
@@ -13,10 +17,12 @@ import dayjs from 'dayjs';
const antdLocale = ref<Locale>(antdDefaultLocale);
const modules = import.meta.glob('./langs/*.json');
const localesMap = loadLocalesMap(modules);
const modules = import.meta.glob('./langs/**/*.json');
const localesMap = loadLocalesMapFromDir(
/\.\/langs\/([^/]+)\/(.*)\.json$/,
modules,
);
/**
* 加载应用特有的语言包
* 这里也可以改造为从服务端获取翻译数据

View File

@@ -1,125 +0,0 @@
{
"page": {
"demos": {
"title": "Demos",
"access": {
"frontendPermissions": "Frontend Permissions",
"backendPermissions": "Backend Permissions",
"pageAccess": "Page Access",
"buttonControl": "Button Control",
"menuVisible403": "Menu Visible(403)",
"superVisible": "Visible to Super",
"adminVisible": "Visible to Admin",
"userVisible": "Visible to User"
},
"nested": {
"title": "Nested Menu",
"menu1": "Menu 1",
"menu2": "Menu 2",
"menu2_1": "Menu 2-1",
"menu3": "Menu 3",
"menu3_1": "Menu 3-1",
"menu3_2": "Menu 3-2",
"menu3_2_1": "Menu 3-2-1"
},
"outside": {
"title": "External Pages",
"embedded": "Embedded",
"externalLink": "External Link"
},
"badge": {
"title": "Menu Badge",
"dot": "Dot Badge",
"text": "Text Badge",
"color": "Badge Color"
},
"activeIcon": {
"title": "Active Menu Icon",
"children": "Children Active Icon"
},
"fallback": {
"title": "Fallback Page"
},
"features": {
"title": "Features",
"hideChildrenInMenu": "Hide Menu Children",
"loginExpired": "Login Expired",
"icons": "Icons",
"watermark": "Watermark",
"tabs": "Tabs",
"tabDetail": "Tab Detail Page",
"fullScreen": {
"title": "FullScreen"
},
"clipboard": "Clipboard"
},
"breadcrumb": {
"navigation": "Breadcrumb Navigation",
"lateral": "Lateral Mode",
"lateralDetail": "Lateral Mode Detail",
"level": "Level Mode",
"levelDetail": "Level Mode Detail"
}
},
"examples": {
"title": "Examples",
"modal": {
"title": "Modal"
},
"drawer": {
"title": "Drawer"
},
"ellipsis": {
"title": "EllipsisText"
},
"form": {
"title": "Form",
"basic": "Basic Form",
"query": "Query Form",
"rules": "Form Rules",
"dynamic": "Dynamic Form",
"custom": "Custom Component",
"api": "Api",
"merge": "Merge Form"
},
"vxeTable": {
"title": "Vxe Table",
"basic": "Basic Table",
"remote": "Remote Load",
"tree": "Tree Table",
"fixed": "Fixed Header/Column",
"virtual": "Virtual Scroll",
"editCell": "Edit Cell",
"editRow": "Edit Row",
"custom-cell": "Custom Cell",
"form": "Form Table"
},
"captcha": {
"title": "Captcha",
"pointSelection": "Point Selection Captcha",
"sliderCaptcha": "Slider Captcha",
"sliderRotateCaptcha": "Rotate Captcha",
"captchaCardTitle": "Please complete the security verification",
"pageDescription": "Verify user identity by clicking on specific locations in the image.",
"pageTitle": "Captcha Component Example",
"basic": "Basic Usage",
"titlePlaceholder": "Captcha Title Text",
"captchaImageUrlPlaceholder": "Captcha Image (supports img tag src attribute value)",
"hintImage": "Hint Image",
"hintText": "Hint Text",
"hintImagePlaceholder": "Hint Image (supports img tag src attribute value)",
"hintTextPlaceholder": "Hint Text",
"showConfirm": "Show Confirm",
"hideConfirm": "Hide Confirm",
"widthPlaceholder": "Captcha Image Width Default 300px",
"heightPlaceholder": "Captcha Image Height Default 220px",
"paddingXPlaceholder": "Horizontal Padding Default 12px",
"paddingYPlaceholder": "Vertical Padding Default 16px",
"index": "Index:",
"timestamp": "Timestamp:",
"x": "x:",
"y": "y:"
}
}
}
}

View File

@@ -0,0 +1,69 @@
{
"title": "Demos",
"access": {
"frontendPermissions": "Frontend Permissions",
"backendPermissions": "Backend Permissions",
"pageAccess": "Page Access",
"buttonControl": "Button Control",
"menuVisible403": "Menu Visible(403)",
"superVisible": "Visible to Super",
"adminVisible": "Visible to Admin",
"userVisible": "Visible to User"
},
"nested": {
"title": "Nested Menu",
"menu1": "Menu 1",
"menu2": "Menu 2",
"menu2_1": "Menu 2-1",
"menu3": "Menu 3",
"menu3_1": "Menu 3-1",
"menu3_2": "Menu 3-2",
"menu3_2_1": "Menu 3-2-1"
},
"outside": {
"title": "External Pages",
"embedded": "Embedded",
"externalLink": "External Link"
},
"badge": {
"title": "Menu Badge",
"dot": "Dot Badge",
"text": "Text Badge",
"color": "Badge Color"
},
"activeIcon": {
"title": "Active Menu Icon",
"children": "Children Active Icon"
},
"fallback": {
"title": "Fallback Page"
},
"features": {
"title": "Features",
"hideChildrenInMenu": "Hide Menu Children",
"loginExpired": "Login Expired",
"icons": "Icons",
"watermark": "Watermark",
"tabs": "Tabs",
"tabDetail": "Tab Detail Page",
"fullScreen": {
"title": "FullScreen"
},
"clipboard": "Clipboard"
},
"breadcrumb": {
"navigation": "Breadcrumb Navigation",
"lateral": "Lateral Mode",
"lateralDetail": "Lateral Mode Detail",
"level": "Level Mode",
"levelDetail": "Level Mode Detail"
},
"vben": {
"title": "Project",
"about": "About",
"document": "Document",
"antdv": "Ant Design Vue Version",
"naive-ui": "Naive UI Version",
"element-plus": "Element Plus Version"
}
}

View File

@@ -0,0 +1,60 @@
{
"title": "Examples",
"modal": {
"title": "Modal"
},
"drawer": {
"title": "Drawer"
},
"ellipsis": {
"title": "EllipsisText"
},
"form": {
"title": "Form",
"basic": "Basic Form",
"query": "Query Form",
"rules": "Form Rules",
"dynamic": "Dynamic Form",
"custom": "Custom Component",
"api": "Api",
"merge": "Merge Form"
},
"vxeTable": {
"title": "Vxe Table",
"basic": "Basic Table",
"remote": "Remote Load",
"tree": "Tree Table",
"fixed": "Fixed Header/Column",
"virtual": "Virtual Scroll",
"editCell": "Edit Cell",
"editRow": "Edit Row",
"custom-cell": "Custom Cell",
"form": "Form Table"
},
"captcha": {
"title": "Captcha",
"pointSelection": "Point Selection Captcha",
"sliderCaptcha": "Slider Captcha",
"sliderRotateCaptcha": "Rotate Captcha",
"captchaCardTitle": "Please complete the security verification",
"pageDescription": "Verify user identity by clicking on specific locations in the image.",
"pageTitle": "Captcha Component Example",
"basic": "Basic Usage",
"titlePlaceholder": "Captcha Title Text",
"captchaImageUrlPlaceholder": "Captcha Image (supports img tag src attribute value)",
"hintImage": "Hint Image",
"hintText": "Hint Text",
"hintImagePlaceholder": "Hint Image (supports img tag src attribute value)",
"hintTextPlaceholder": "Hint Text",
"showConfirm": "Show Confirm",
"hideConfirm": "Hide Confirm",
"widthPlaceholder": "Captcha Image Width Default 300px",
"heightPlaceholder": "Captcha Image Height Default 220px",
"paddingXPlaceholder": "Horizontal Padding Default 12px",
"paddingYPlaceholder": "Vertical Padding Default 16px",
"index": "Index:",
"timestamp": "Timestamp:",
"x": "x:",
"y": "y:"
}
}

View File

@@ -0,0 +1,14 @@
{
"auth": {
"login": "Login",
"register": "Register",
"codeLogin": "Code Login",
"qrcodeLogin": "Qr Code Login",
"forgetPassword": "Forget Password"
},
"dashboard": {
"title": "Dashboard",
"analytics": "Analytics",
"workspace": "Workspace"
}
}

View File

@@ -1,125 +0,0 @@
{
"page": {
"demos": {
"title": "演示",
"access": {
"frontendPermissions": "前端权限",
"backendPermissions": "后端权限",
"pageAccess": "页面访问",
"buttonControl": "按钮控制",
"menuVisible403": "菜单可见(403)",
"superVisible": "Super 可见",
"adminVisible": "Admin 可见",
"userVisible": "User 可见"
},
"nested": {
"title": "嵌套菜单",
"menu1": "菜单 1",
"menu2": "菜单 2",
"menu2_1": "菜单 2-1",
"menu3": "菜单 3",
"menu3_1": "菜单 3-1",
"menu3_2": "菜单 3-2",
"menu3_2_1": "菜单 3-2-1"
},
"outside": {
"title": "外部页面",
"embedded": "内嵌",
"externalLink": "外链"
},
"badge": {
"title": "菜单徽标",
"dot": "点徽标",
"text": "文本徽标",
"color": "徽标颜色"
},
"activeIcon": {
"title": "菜单激活图标",
"children": "子级激活图标"
},
"fallback": {
"title": "缺省页"
},
"features": {
"title": "功能",
"hideChildrenInMenu": "隐藏子菜单",
"loginExpired": "登录过期",
"icons": "图标",
"watermark": "水印",
"tabs": "标签页",
"tabDetail": "标签详情页",
"fullScreen": {
"title": "全屏"
},
"clipboard": "剪贴板"
},
"breadcrumb": {
"navigation": "面包屑导航",
"lateral": "平级模式",
"level": "层级模式",
"levelDetail": "层级模式详情",
"lateralDetail": "平级模式详情"
}
},
"examples": {
"title": "示例",
"modal": {
"title": "弹窗"
},
"drawer": {
"title": "抽屉"
},
"ellipsis": {
"title": "文本省略"
},
"form": {
"title": "表单",
"basic": "基础表单",
"query": "查询表单",
"rules": "表单校验",
"dynamic": "动态表单",
"custom": "自定义组件",
"api": "Api",
"merge": "合并表单"
},
"vxeTable": {
"title": "Vxe 表格",
"basic": "基础表格",
"remote": "远程加载",
"tree": "树形表格",
"fixed": "固定表头/列",
"virtual": "虚拟滚动",
"editCell": "单元格编辑",
"editRow": "行编辑",
"custom-cell": "自定义单元格",
"form": "搜索表单"
},
"captcha": {
"title": "验证码",
"pointSelection": "点选验证",
"sliderCaptcha": "滑块验证",
"sliderRotateCaptcha": "旋转验证",
"captchaCardTitle": "请完成安全验证",
"pageDescription": "通过点击图片中的特定位置来验证用户身份。",
"pageTitle": "验证码组件示例",
"basic": "基本使用",
"titlePlaceholder": "验证码标题文案",
"captchaImageUrlPlaceholder": "验证码图片支持img标签src属性值",
"hintImage": "提示图片",
"hintText": "提示文本",
"hintImagePlaceholder": "提示图片支持img标签src属性值",
"hintTextPlaceholder": "提示文本",
"showConfirm": "展示确认",
"hideConfirm": "隐藏确认",
"widthPlaceholder": "验证码图片宽度 默认300px",
"heightPlaceholder": "验证码图片高度 默认220px",
"paddingXPlaceholder": "水平内边距 默认12px",
"paddingYPlaceholder": "垂直内边距 默认16px",
"index": "索引:",
"timestamp": "时间戳:",
"x": "x",
"y": "y"
}
}
}
}

View File

@@ -0,0 +1,69 @@
{
"title": "演示",
"access": {
"frontendPermissions": "前端权限",
"backendPermissions": "后端权限",
"pageAccess": "页面访问",
"buttonControl": "按钮控制",
"menuVisible403": "菜单可见(403)",
"superVisible": "Super 可见",
"adminVisible": "Admin 可见",
"userVisible": "User 可见"
},
"nested": {
"title": "嵌套菜单",
"menu1": "菜单 1",
"menu2": "菜单 2",
"menu2_1": "菜单 2-1",
"menu3": "菜单 3",
"menu3_1": "菜单 3-1",
"menu3_2": "菜单 3-2",
"menu3_2_1": "菜单 3-2-1"
},
"outside": {
"title": "外部页面",
"embedded": "内嵌",
"externalLink": "外链"
},
"badge": {
"title": "菜单徽标",
"dot": "点徽标",
"text": "文本徽标",
"color": "徽标颜色"
},
"activeIcon": {
"title": "菜单激活图标",
"children": "子级激活图标"
},
"fallback": {
"title": "缺省页"
},
"features": {
"title": "功能",
"hideChildrenInMenu": "隐藏子菜单",
"loginExpired": "登录过期",
"icons": "图标",
"watermark": "水印",
"tabs": "标签页",
"tabDetail": "标签详情页",
"fullScreen": {
"title": "全屏"
},
"clipboard": "剪贴板"
},
"breadcrumb": {
"navigation": "面包屑导航",
"lateral": "平级模式",
"level": "层级模式",
"levelDetail": "层级模式详情",
"lateralDetail": "平级模式详情"
},
"vben": {
"title": "项目",
"about": "关于",
"document": "文档",
"antdv": "Ant Design Vue 版本",
"naive-ui": "Naive UI 版本",
"element-plus": "Element Plus 版本"
}
}

View File

@@ -0,0 +1,60 @@
{
"title": "示例",
"modal": {
"title": "弹窗"
},
"drawer": {
"title": "抽屉"
},
"ellipsis": {
"title": "文本省略"
},
"form": {
"title": "表单",
"basic": "基础表单",
"query": "查询表单",
"rules": "表单校验",
"dynamic": "动态表单",
"custom": "自定义组件",
"api": "Api",
"merge": "合并表单"
},
"vxeTable": {
"title": "Vxe 表格",
"basic": "基础表格",
"remote": "远程加载",
"tree": "树形表格",
"fixed": "固定表头/列",
"virtual": "虚拟滚动",
"editCell": "单元格编辑",
"editRow": "行编辑",
"custom-cell": "自定义单元格",
"form": "搜索表单"
},
"captcha": {
"title": "验证码",
"pointSelection": "点选验证",
"sliderCaptcha": "滑块验证",
"sliderRotateCaptcha": "旋转验证",
"captchaCardTitle": "请完成安全验证",
"pageDescription": "通过点击图片中的特定位置来验证用户身份。",
"pageTitle": "验证码组件示例",
"basic": "基本使用",
"titlePlaceholder": "验证码标题文案",
"captchaImageUrlPlaceholder": "验证码图片支持img标签src属性值",
"hintImage": "提示图片",
"hintText": "提示文本",
"hintImagePlaceholder": "提示图片支持img标签src属性值",
"hintTextPlaceholder": "提示文本",
"showConfirm": "展示确认",
"hideConfirm": "隐藏确认",
"widthPlaceholder": "验证码图片宽度 默认300px",
"heightPlaceholder": "验证码图片高度 默认220px",
"paddingXPlaceholder": "水平内边距 默认12px",
"paddingYPlaceholder": "垂直内边距 默认16px",
"index": "索引:",
"timestamp": "时间戳:",
"x": "x",
"y": "y"
}
}

View File

@@ -0,0 +1,14 @@
{
"auth": {
"login": "登陆",
"register": "注册",
"codeLogin": "验证码登陆",
"qrcodeLogin": "二维码登陆",
"forgetPassword": "忘记密码"
},
"dashboard": {
"title": "概览",
"analytics": "分析页",
"workspace": "工作台"
}
}

View File

@@ -43,7 +43,7 @@ const coreRoutes: RouteRecordRaw[] = [
path: 'login',
component: Login,
meta: {
title: $t('page.core.login'),
title: $t('page.auth.login'),
},
},
{
@@ -51,7 +51,7 @@ const coreRoutes: RouteRecordRaw[] = [
path: 'code-login',
component: () => import('#/views/_core/authentication/code-login.vue'),
meta: {
title: $t('page.core.codeLogin'),
title: $t('page.auth.codeLogin'),
},
},
{
@@ -60,7 +60,7 @@ const coreRoutes: RouteRecordRaw[] = [
component: () =>
import('#/views/_core/authentication/qrcode-login.vue'),
meta: {
title: $t('page.core.qrcodeLogin'),
title: $t('page.auth.qrcodeLogin'),
},
},
{
@@ -69,7 +69,7 @@ const coreRoutes: RouteRecordRaw[] = [
component: () =>
import('#/views/_core/authentication/forget-password.vue'),
meta: {
title: $t('page.core.forgetPassword'),
title: $t('page.auth.forgetPassword'),
},
},
{
@@ -77,7 +77,7 @@ const coreRoutes: RouteRecordRaw[] = [
path: 'register',
component: () => import('#/views/_core/authentication/register.vue'),
meta: {
title: $t('page.core.register'),
title: $t('page.auth.register'),
},
},
],

View File

@@ -10,7 +10,7 @@ const routes: RouteRecordRaw[] = [
icon: 'ic:baseline-view-in-ar',
keepAlive: true,
order: 1000,
title: $t('page.demos.title'),
title: $t('demos.title'),
},
name: 'Demos',
path: '/demos',
@@ -19,7 +19,7 @@ const routes: RouteRecordRaw[] = [
{
meta: {
icon: 'mdi:shield-key-outline',
title: $t('page.demos.access.frontendPermissions'),
title: $t('demos.access.frontendPermissions'),
},
name: 'AccessDemos',
path: '/demos/access',
@@ -30,7 +30,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/demos/access/index.vue'),
meta: {
icon: 'mdi:page-previous-outline',
title: $t('page.demos.access.pageAccess'),
title: $t('demos.access.pageAccess'),
},
},
{
@@ -39,7 +39,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/demos/access/button-control.vue'),
meta: {
icon: 'mdi:button-cursor',
title: $t('page.demos.access.buttonControl'),
title: $t('demos.access.buttonControl'),
},
},
{
@@ -51,7 +51,7 @@ const routes: RouteRecordRaw[] = [
authority: ['no-body'],
icon: 'mdi:button-cursor',
menuVisibleWithForbidden: true,
title: $t('page.demos.access.menuVisible403'),
title: $t('demos.access.menuVisible403'),
},
},
{
@@ -61,7 +61,7 @@ const routes: RouteRecordRaw[] = [
meta: {
authority: ['super'],
icon: 'mdi:button-cursor',
title: $t('page.demos.access.superVisible'),
title: $t('demos.access.superVisible'),
},
},
{
@@ -71,7 +71,7 @@ const routes: RouteRecordRaw[] = [
meta: {
authority: ['admin'],
icon: 'mdi:button-cursor',
title: $t('page.demos.access.adminVisible'),
title: $t('demos.access.adminVisible'),
},
},
{
@@ -81,7 +81,7 @@ const routes: RouteRecordRaw[] = [
meta: {
authority: ['user'],
icon: 'mdi:button-cursor',
title: $t('page.demos.access.userVisible'),
title: $t('demos.access.userVisible'),
},
},
],
@@ -90,7 +90,7 @@ const routes: RouteRecordRaw[] = [
{
meta: {
icon: 'mdi:feature-highlight',
title: $t('page.demos.features.title'),
title: $t('demos.features.title'),
},
name: 'FeaturesDemos',
path: '/demos/features',
@@ -102,7 +102,7 @@ const routes: RouteRecordRaw[] = [
import('#/views/demos/features/login-expired/index.vue'),
meta: {
icon: 'mdi:encryption-expiration',
title: $t('page.demos.features.loginExpired'),
title: $t('demos.features.loginExpired'),
},
},
{
@@ -111,7 +111,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/demos/features/icons/index.vue'),
meta: {
icon: 'lucide:annoyed',
title: $t('page.demos.features.icons'),
title: $t('demos.features.icons'),
},
},
{
@@ -121,7 +121,7 @@ const routes: RouteRecordRaw[] = [
import('#/views/demos/features/watermark/index.vue'),
meta: {
icon: 'lucide:tags',
title: $t('page.demos.features.watermark'),
title: $t('demos.features.watermark'),
},
},
{
@@ -130,7 +130,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/demos/features/tabs/index.vue'),
meta: {
icon: 'lucide:app-window',
title: $t('page.demos.features.tabs'),
title: $t('demos.features.tabs'),
},
},
{
@@ -142,7 +142,7 @@ const routes: RouteRecordRaw[] = [
activePath: '/demos/features/tabs',
hideInMenu: true,
maxNumOfOpenTab: 3,
title: $t('page.demos.features.tabDetail'),
title: $t('demos.features.tabDetail'),
},
},
{
@@ -153,7 +153,7 @@ const routes: RouteRecordRaw[] = [
meta: {
hideChildrenInMenu: true,
icon: 'ic:round-menu',
title: $t('page.demos.features.hideChildrenInMenu'),
title: $t('demos.features.hideChildrenInMenu'),
},
children: [
{
@@ -163,7 +163,7 @@ const routes: RouteRecordRaw[] = [
import(
'#/views/demos/features/hide-menu-children/children.vue'
),
meta: { title: $t('page.demos.features.hideChildrenInMenu') },
meta: { title: $t('demos.features.hideChildrenInMenu') },
},
],
},
@@ -174,7 +174,7 @@ const routes: RouteRecordRaw[] = [
import('#/views/demos/features/full-screen/index.vue'),
meta: {
icon: 'lucide:fullscreen',
title: $t('page.demos.features.fullScreen.title'),
title: $t('demos.features.fullScreen.title'),
},
},
{
@@ -184,7 +184,7 @@ const routes: RouteRecordRaw[] = [
import('#/views/demos/features/clipboard/index.vue'),
meta: {
icon: 'lucide:copy',
title: $t('page.demos.features.clipboard'),
title: $t('demos.features.clipboard'),
},
},
{
@@ -205,7 +205,7 @@ const routes: RouteRecordRaw[] = [
path: '/demos/breadcrumb',
meta: {
icon: 'lucide:navigation',
title: $t('page.demos.breadcrumb.navigation'),
title: $t('demos.breadcrumb.navigation'),
},
children: [
{
@@ -214,7 +214,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/demos/breadcrumb/lateral.vue'),
meta: {
icon: 'lucide:navigation',
title: $t('page.demos.breadcrumb.lateral'),
title: $t('demos.breadcrumb.lateral'),
},
},
{
@@ -225,7 +225,7 @@ const routes: RouteRecordRaw[] = [
meta: {
activePath: '/demos/breadcrumb/lateral',
hideInMenu: true,
title: $t('page.demos.breadcrumb.lateralDetail'),
title: $t('demos.breadcrumb.lateralDetail'),
},
},
{
@@ -233,7 +233,7 @@ const routes: RouteRecordRaw[] = [
path: '/demos/breadcrumb/level',
meta: {
icon: 'lucide:navigation',
title: $t('page.demos.breadcrumb.level'),
title: $t('demos.breadcrumb.level'),
},
children: [
{
@@ -242,7 +242,7 @@ const routes: RouteRecordRaw[] = [
component: () =>
import('#/views/demos/breadcrumb/level-detail.vue'),
meta: {
title: $t('page.demos.breadcrumb.levelDetail'),
title: $t('demos.breadcrumb.levelDetail'),
},
},
],
@@ -253,7 +253,7 @@ const routes: RouteRecordRaw[] = [
{
meta: {
icon: 'mdi:lightbulb-error-outline',
title: $t('page.demos.fallback.title'),
title: $t('demos.fallback.title'),
},
name: 'FallbackDemos',
path: '/demos/fallback',
@@ -292,7 +292,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/_core/fallback/offline.vue'),
meta: {
icon: 'mdi:offline',
title: $t('fallback.offline'),
title: $t('ui.fallback.offline'),
},
},
],
@@ -303,7 +303,7 @@ const routes: RouteRecordRaw[] = [
badgeType: 'dot',
badgeVariants: 'destructive',
icon: 'lucide:circle-dot',
title: $t('page.demos.badge.title'),
title: $t('demos.badge.title'),
},
name: 'BadgeDemos',
path: '/demos/badge',
@@ -315,7 +315,7 @@ const routes: RouteRecordRaw[] = [
meta: {
badgeType: 'dot',
icon: 'lucide:square-dot',
title: $t('page.demos.badge.dot'),
title: $t('demos.badge.dot'),
},
},
{
@@ -325,7 +325,7 @@ const routes: RouteRecordRaw[] = [
meta: {
badge: '10',
icon: 'lucide:square-dot',
title: $t('page.demos.badge.text'),
title: $t('demos.badge.text'),
},
},
{
@@ -336,7 +336,7 @@ const routes: RouteRecordRaw[] = [
badge: 'Hot',
badgeVariants: 'destructive',
icon: 'lucide:square-dot',
title: $t('page.demos.badge.color'),
title: $t('demos.badge.color'),
},
},
],
@@ -346,7 +346,7 @@ const routes: RouteRecordRaw[] = [
meta: {
activeIcon: 'fluent-emoji:radioactive',
icon: 'bi:radioactive',
title: $t('page.demos.activeIcon.title'),
title: $t('demos.activeIcon.title'),
},
name: 'ActiveIconDemos',
path: '/demos/active-icon',
@@ -358,7 +358,7 @@ const routes: RouteRecordRaw[] = [
meta: {
activeIcon: 'fluent-emoji:radioactive',
icon: 'bi:radioactive',
title: $t('page.demos.activeIcon.children'),
title: $t('demos.activeIcon.children'),
},
},
],
@@ -367,7 +367,7 @@ const routes: RouteRecordRaw[] = [
{
meta: {
icon: 'ic:round-settings-input-composite',
title: $t('page.demos.outside.title'),
title: $t('demos.outside.title'),
},
name: 'OutsideDemos',
path: '/demos/outside',
@@ -377,7 +377,7 @@ const routes: RouteRecordRaw[] = [
path: '/demos/outside/iframe',
meta: {
icon: 'mdi:newspaper-variant-outline',
title: $t('page.demos.outside.embedded'),
title: $t('demos.outside.embedded'),
},
children: [
{
@@ -409,7 +409,7 @@ const routes: RouteRecordRaw[] = [
path: '/demos/outside/external-link',
meta: {
icon: 'mdi:newspaper-variant-multiple-outline',
title: $t('page.demos.outside.externalLink'),
title: $t('demos.outside.externalLink'),
},
children: [
{
@@ -440,7 +440,7 @@ const routes: RouteRecordRaw[] = [
{
meta: {
icon: 'ic:round-menu',
title: $t('page.demos.nested.title'),
title: $t('demos.nested.title'),
},
name: 'NestedDemos',
path: '/demos/nested',
@@ -452,7 +452,7 @@ const routes: RouteRecordRaw[] = [
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.demos.nested.menu1'),
title: $t('demos.nested.menu1'),
},
},
{
@@ -461,7 +461,7 @@ const routes: RouteRecordRaw[] = [
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.demos.nested.menu2'),
title: $t('demos.nested.menu2'),
},
children: [
{
@@ -471,7 +471,7 @@ const routes: RouteRecordRaw[] = [
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.demos.nested.menu2_1'),
title: $t('demos.nested.menu2_1'),
},
},
],
@@ -481,7 +481,7 @@ const routes: RouteRecordRaw[] = [
path: '/demos/nested/menu3',
meta: {
icon: 'ic:round-menu',
title: $t('page.demos.nested.menu3'),
title: $t('demos.nested.menu3'),
},
children: [
{
@@ -491,7 +491,7 @@ const routes: RouteRecordRaw[] = [
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.demos.nested.menu3_1'),
title: $t('demos.nested.menu3_1'),
},
},
{
@@ -499,7 +499,7 @@ const routes: RouteRecordRaw[] = [
path: 'menu3-2',
meta: {
icon: 'ic:round-menu',
title: $t('page.demos.nested.menu3_2'),
title: $t('demos.nested.menu3_2'),
},
children: [
{
@@ -510,7 +510,7 @@ const routes: RouteRecordRaw[] = [
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.demos.nested.menu3_2_1'),
title: $t('demos.nested.menu3_2_1'),
},
},
],

View File

@@ -10,7 +10,7 @@ const routes: RouteRecordRaw[] = [
icon: 'ion:layers-outline',
keepAlive: true,
order: 1000,
title: $t('page.examples.title'),
title: $t('examples.title'),
},
name: 'Examples',
path: '/examples',
@@ -21,7 +21,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/examples/modal/index.vue'),
meta: {
icon: 'system-uicons:window-content',
title: $t('page.examples.modal.title'),
title: $t('examples.modal.title'),
},
},
{
@@ -30,7 +30,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/examples/drawer/index.vue'),
meta: {
icon: 'iconoir:drawer',
title: $t('page.examples.drawer.title'),
title: $t('examples.drawer.title'),
},
},
{
@@ -39,7 +39,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/examples/ellipsis/index.vue'),
meta: {
icon: 'ion:ellipsis-horizontal',
title: $t('page.examples.ellipsis.title'),
title: $t('examples.ellipsis.title'),
},
},
{
@@ -47,7 +47,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/form',
meta: {
icon: 'mdi:form-select',
title: $t('page.examples.form.title'),
title: $t('examples.form.title'),
},
children: [
{
@@ -55,7 +55,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/form/basic',
component: () => import('#/views/examples/form/basic.vue'),
meta: {
title: $t('page.examples.form.basic'),
title: $t('examples.form.basic'),
},
},
{
@@ -63,7 +63,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/form/query',
component: () => import('#/views/examples/form/query.vue'),
meta: {
title: $t('page.examples.form.query'),
title: $t('examples.form.query'),
},
},
{
@@ -71,7 +71,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/form/rules',
component: () => import('#/views/examples/form/rules.vue'),
meta: {
title: $t('page.examples.form.rules'),
title: $t('examples.form.rules'),
},
},
{
@@ -79,7 +79,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/form/dynamic',
component: () => import('#/views/examples/form/dynamic.vue'),
meta: {
title: $t('page.examples.form.dynamic'),
title: $t('examples.form.dynamic'),
},
},
{
@@ -87,7 +87,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/form/custom',
component: () => import('#/views/examples/form/custom.vue'),
meta: {
title: $t('page.examples.form.custom'),
title: $t('examples.form.custom'),
},
},
{
@@ -95,7 +95,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/form/api',
component: () => import('#/views/examples/form/api.vue'),
meta: {
title: $t('page.examples.form.api'),
title: $t('examples.form.api'),
},
},
{
@@ -103,7 +103,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/form/merge',
component: () => import('#/views/examples/form/merge.vue'),
meta: {
title: $t('page.examples.form.merge'),
title: $t('examples.form.merge'),
},
},
],
@@ -113,7 +113,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/vxe-table',
meta: {
icon: 'lucide:table',
title: $t('page.examples.vxeTable.title'),
title: $t('examples.vxeTable.title'),
},
children: [
{
@@ -121,7 +121,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/vxe-table/basic',
component: () => import('#/views/examples/vxe-table/basic.vue'),
meta: {
title: $t('page.examples.vxeTable.basic'),
title: $t('examples.vxeTable.basic'),
},
},
{
@@ -129,7 +129,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/vxe-table/remote',
component: () => import('#/views/examples/vxe-table/remote.vue'),
meta: {
title: $t('page.examples.vxeTable.remote'),
title: $t('examples.vxeTable.remote'),
},
},
{
@@ -137,7 +137,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/vxe-table/tree',
component: () => import('#/views/examples/vxe-table/tree.vue'),
meta: {
title: $t('page.examples.vxeTable.tree'),
title: $t('examples.vxeTable.tree'),
},
},
{
@@ -145,7 +145,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/vxe-table/fixed',
component: () => import('#/views/examples/vxe-table/fixed.vue'),
meta: {
title: $t('page.examples.vxeTable.fixed'),
title: $t('examples.vxeTable.fixed'),
},
},
{
@@ -154,7 +154,7 @@ const routes: RouteRecordRaw[] = [
component: () =>
import('#/views/examples/vxe-table/custom-cell.vue'),
meta: {
title: $t('page.examples.vxeTable.custom-cell'),
title: $t('examples.vxeTable.custom-cell'),
},
},
{
@@ -162,7 +162,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/vxe-table/form',
component: () => import('#/views/examples/vxe-table/form.vue'),
meta: {
title: $t('page.examples.vxeTable.form'),
title: $t('examples.vxeTable.form'),
},
},
{
@@ -170,7 +170,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/vxe-table/edit-cell',
component: () => import('#/views/examples/vxe-table/edit-cell.vue'),
meta: {
title: $t('page.examples.vxeTable.editCell'),
title: $t('examples.vxeTable.editCell'),
},
},
{
@@ -178,7 +178,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/vxe-table/edit-row',
component: () => import('#/views/examples/vxe-table/edit-row.vue'),
meta: {
title: $t('page.examples.vxeTable.editRow'),
title: $t('examples.vxeTable.editRow'),
},
},
{
@@ -186,7 +186,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/vxe-table/virtual',
component: () => import('#/views/examples/vxe-table/virtual.vue'),
meta: {
title: $t('page.examples.vxeTable.virtual'),
title: $t('examples.vxeTable.virtual'),
},
},
],
@@ -196,7 +196,7 @@ const routes: RouteRecordRaw[] = [
path: '/examples/captcha',
meta: {
icon: 'logos:recaptcha',
title: $t('page.examples.captcha.title'),
title: $t('examples.captcha.title'),
},
children: [
{
@@ -205,7 +205,7 @@ const routes: RouteRecordRaw[] = [
component: () =>
import('#/views/examples/captcha/slider-captcha.vue'),
meta: {
title: $t('page.examples.captcha.sliderCaptcha'),
title: $t('examples.captcha.sliderCaptcha'),
},
},
{
@@ -214,7 +214,7 @@ const routes: RouteRecordRaw[] = [
component: () =>
import('#/views/examples/captcha/slider-rotate-captcha.vue'),
meta: {
title: $t('page.examples.captcha.sliderRotateCaptcha'),
title: $t('examples.captcha.sliderRotateCaptcha'),
},
},
{
@@ -223,7 +223,7 @@ const routes: RouteRecordRaw[] = [
component: () =>
import('#/views/examples/captcha/point-selection-captcha.vue'),
meta: {
title: $t('page.examples.captcha.pointSelection'),
title: $t('examples.captcha.pointSelection'),
},
},
],

View File

@@ -20,7 +20,7 @@ const routes: RouteRecordRaw[] = [
badgeType: 'dot',
icon: VBEN_LOGO_URL,
order: 9999,
title: $t('page.vben.title'),
title: $t('demos.vben.title'),
},
name: 'VbenProject',
path: '/vben-admin',
@@ -31,7 +31,7 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/_core/about/index.vue'),
meta: {
icon: 'lucide:copyright',
title: $t('page.vben.about'),
title: $t('demos.vben.about'),
},
},
{
@@ -41,7 +41,7 @@ const routes: RouteRecordRaw[] = [
meta: {
icon: 'lucide:book-open-text',
link: VBEN_DOC_URL,
title: $t('page.vben.document'),
title: $t('demos.vben.document'),
},
},
{
@@ -62,7 +62,7 @@ const routes: RouteRecordRaw[] = [
badgeType: 'dot',
icon: SvgAntdvLogoIcon,
link: VBEN_ANT_PREVIEW_URL,
title: $t('page.vben.antdv'),
title: $t('demos.vben.antdv'),
},
},
{
@@ -73,7 +73,7 @@ const routes: RouteRecordRaw[] = [
badgeType: 'dot',
icon: 'logos:naiveui',
link: VBEN_NAIVE_PREVIEW_URL,
title: $t('page.vben.naive-ui'),
title: $t('demos.vben.naive-ui'),
},
},
{
@@ -84,7 +84,7 @@ const routes: RouteRecordRaw[] = [
badgeType: 'dot',
icon: 'logos:element',
link: VBEN_ELE_PREVIEW_URL,
title: $t('page.vben.element-plus'),
title: $t('demos.vben.element-plus'),
},
},
],

View File

@@ -47,47 +47,44 @@ const handleClick = (point: CaptchaPoint) => {
<template>
<Page
:description="$t('page.examples.captcha.pageDescription')"
:title="$t('page.examples.captcha.pageTitle')"
:description="$t('examples.captcha.pageDescription')"
:title="$t('examples.captcha.pageTitle')"
>
<Card
:title="$t('page.examples.captcha.basic')"
class="mb-4 overflow-x-auto"
>
<Card :title="$t('examples.captcha.basic')" class="mb-4 overflow-x-auto">
<div class="mb-3 flex items-center justify-start">
<Input
v-model:value="params.title"
:placeholder="$t('page.examples.captcha.titlePlaceholder')"
:placeholder="$t('examples.captcha.titlePlaceholder')"
class="w-64"
/>
<Input
v-model:value="params.captchaImageUrl"
:placeholder="$t('page.examples.captcha.captchaImageUrlPlaceholder')"
:placeholder="$t('examples.captcha.captchaImageUrlPlaceholder')"
class="ml-8 w-64"
/>
<div class="ml-8 flex w-96 items-center">
<Switch
v-model:checked="params.showHintImage"
:checked-children="$t('page.examples.captcha.hintImage')"
:un-checked-children="$t('page.examples.captcha.hintText')"
:checked-children="$t('examples.captcha.hintImage')"
:un-checked-children="$t('examples.captcha.hintText')"
class="mr-4 w-40"
/>
<Input
v-show="params.showHintImage"
v-model:value="params.hintImageUrl"
:placeholder="$t('page.examples.captcha.hintImagePlaceholder')"
:placeholder="$t('examples.captcha.hintImagePlaceholder')"
/>
<Input
v-show="!params.showHintImage"
v-model:value="params.hintText"
:placeholder="$t('page.examples.captcha.hintTextPlaceholder')"
:placeholder="$t('examples.captcha.hintTextPlaceholder')"
/>
</div>
<Switch
v-model:checked="params.showConfirm"
:checked-children="$t('page.examples.captcha.showConfirm')"
:un-checked-children="$t('page.examples.captcha.hideConfirm')"
:checked-children="$t('examples.captcha.showConfirm')"
:un-checked-children="$t('examples.captcha.hideConfirm')"
class="ml-8 w-28"
/>
</div>
@@ -96,7 +93,7 @@ const handleClick = (point: CaptchaPoint) => {
<InputNumber
v-model:value="params.width"
:min="1"
:placeholder="$t('page.examples.captcha.widthPlaceholder')"
:placeholder="$t('examples.captcha.widthPlaceholder')"
:precision="0"
:step="1"
class="w-64"
@@ -108,7 +105,7 @@ const handleClick = (point: CaptchaPoint) => {
<InputNumber
v-model:value="params.height"
:min="1"
:placeholder="$t('page.examples.captcha.heightPlaceholder')"
:placeholder="$t('examples.captcha.heightPlaceholder')"
:precision="0"
:step="1"
class="w-64"
@@ -120,7 +117,7 @@ const handleClick = (point: CaptchaPoint) => {
<InputNumber
v-model:value="params.paddingX"
:min="1"
:placeholder="$t('page.examples.captcha.paddingXPlaceholder')"
:placeholder="$t('examples.captcha.paddingXPlaceholder')"
:precision="0"
:step="1"
class="w-64"
@@ -132,7 +129,7 @@ const handleClick = (point: CaptchaPoint) => {
<InputNumber
v-model:value="params.paddingY"
:min="1"
:placeholder="$t('page.examples.captcha.paddingYPlaceholder')"
:placeholder="$t('examples.captcha.paddingYPlaceholder')"
:precision="0"
:step="1"
class="w-64"
@@ -159,23 +156,23 @@ const handleClick = (point: CaptchaPoint) => {
@refresh="handleRefresh"
>
<template #title>
{{ params.title || $t('page.examples.captcha.captchaCardTitle') }}
{{ params.title || $t('examples.captcha.captchaCardTitle') }}
</template>
</PointSelectionCaptcha>
<ol class="float-left p-5">
<li v-for="point in selectedPoints" :key="point.i" class="flex">
<span class="mr-3 w-16">{{
$t('page.examples.captcha.index') + point.i
$t('examples.captcha.index') + point.i
}}</span>
<span class="mr-3 w-52">{{
$t('page.examples.captcha.timestamp') + point.t
$t('examples.captcha.timestamp') + point.t
}}</span>
<span class="mr-3 w-16">{{
$t('page.examples.captcha.x') + point.x
$t('examples.captcha.x') + point.x
}}</span>
<span class="mr-3 w-16">{{
$t('page.examples.captcha.y') + point.y
$t('examples.captcha.y') + point.y
}}</span>
</li>
</ol>