We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d18902d commit 2472107Copy full SHA for 2472107
src/utils/i18n.js
@@ -1,4 +1,10 @@
1
// translate router.meta.title, be used in breadcrumb sidebar tagsview
2
export function generateTitle(title) {
3
- return this.$t('route.' + title) // $t :this method from vue-i18n, inject in @/lang/index.js
+ const hasKey = this.$te('route.' + title)
4
+ const translatedTitle = this.$t('route.' + title) // $t :this method from vue-i18n, inject in @/lang/index.js
5
+
6
+ if (hasKey) {
7
+ return translatedTitle
8
+ }
9
+ return title
10
}
0 commit comments