feat(projects): 增加i18n支持翻译菜单,tab,title

This commit is contained in:
cc
2023-05-13 12:58:35 +08:00
parent a765da6e28
commit 3d48aa8bbe
19 changed files with 116 additions and 33 deletions

View File

@ -31,6 +31,8 @@ declare namespace AuthRoute {
interface RouteMeta<K extends AuthRoute.RoutePath> {
/** 路由标题(可用来作document.title或者菜单的名称) */
title: string;
/** 用来支持多国语言 如果i18nTitle和title同时存在优先使用i18nTitle */
i18nTitle?: string;
/** 路由的动态路径(需要动态路径的页面需要将path添加进范型参数) */
dynamicPath?: AuthRouteUtils.GetDynamicPath<K>;
/** 作为单级路由的父级路由布局组件 */

View File

@ -18,5 +18,7 @@ declare namespace StorageInterface {
themeSettings: Theme.Setting;
/** 多页签路由信息 */
multiTabRoutes: App.GlobalTabRoute[];
/** 本地语言缓存 */
lang: I18nType.langType;
}
}

View File

@ -242,6 +242,7 @@ declare namespace App {
routePath: string;
icon?: () => import('vue').VNodeChild;
children?: GlobalMenuOption[];
i18nTitle?: string;
};
/** 面包屑 */
@ -252,6 +253,7 @@ declare namespace App {
routeName: string;
hasChildren: boolean;
icon?: import('vue').Component;
i18nTitle?: string;
options?: import('naive-ui/es/dropdown/src/interface').DropdownMixedOption[];
};
@ -300,6 +302,7 @@ declare namespace App {
}
declare namespace I18nType {
type langType = 'en' | 'zh-CN';
interface Schema {
system: {
title: string;