1
2
3
4
5
6
7
8
9
10
11
12
| // translate router.meta.title, be used in breadcrumb sidebar tagsview
| import i18n from '@/lang/index';
|
| export const translateRouteTitleI18n = (title: string): string => {
| // 判断是否存在国际化配置,如果没有原生返回
| const hasKey = i18n.global.te('route.' + title);
| if (hasKey) {
| const translatedTitle = i18n.global.t('route.' + title);
| return translatedTitle;
| }
| return title;
| };
|
|