fix 修改国际化文件名称不规范问题,增加reqeust 国际化配置

This commit is contained in:
LiuHao
2023-04-19 11:05:30 +08:00
parent 4775803427
commit 20f64b54d5
7 changed files with 36 additions and 25 deletions

View File

@@ -1,8 +1,12 @@
// translate router.meta.title, be used in breadcrumb sidebar tagsview
import i18n from '@/lang/index';
export const translateRouteTitleI18n = (title: string): string => {
// 判断是否存在国际化配置,如果没有原生返回
/**
* 获取国际化路由,如果不存在则原生返回
* @param title 路由名称
* @returns {string}
*/
export const translateRouteTitle = (title: string): string => {
const hasKey = i18n.global.te('route.' + title);
if (hasKey) {
const translatedTitle = i18n.global.t('route.' + title);