李兴辉 b7a8553bbf init
2025-03-10 13:48:17 +08:00

12 lines
322 B
TypeScript

import i18n from '@/lang/index';
export function generateTitle(title: any) {
// 判断是否存在国际化配置,如果没有原生返回
const hasKey = i18n.global.te('route.' + title);
if (hasKey) {
const translatedTitle = i18n.global.t('route.' + title);
return translatedTitle;
}
return title;
}