1
0
forked from dyf/dyf-vue-ui
Files
dyf-vue-ui/src/utils/i18n.ts

17 lines
464 B
TypeScript
Raw Normal View History

2025-06-26 15:29:07 +08:00
// translate router.meta.title, be used in breadcrumb sidebar tagsview
import i18n from '@/lang/index';
/**
*
* @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);
return translatedTitle;
}
return title;
};