Skip to content

Commit 2ec11bd

Browse files
committed
🐛 fix: Fix "donot show multi-language options when setted the sidebarGroupOrder" error
Signed-off-by: sqrtthree <[email protected]>
1 parent 3c376bf commit 2ec11bd

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

components/Sidebar/index.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ export default {
8484
this.$localePath
8585
)
8686
87+
const langTitle = config.get(this.$site, 'selectText', this.$localePath) || 'other-languages'
88+
8789
if (groupOrderConfig) {
8890
const result = groupOrderConfig.slice()
8991
90-
result.unshift('other-languages', 'home')
92+
result.unshift(langTitle, 'home')
93+
9194
return result
9295
} else {
9396
return Object.keys(this.items)

docs/.vuepress/config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ module.exports = {
1818
},
1919
},
2020
themeConfig: {
21+
locales: {
22+
'/': {
23+
selectText: 'Languages',
24+
label: 'English',
25+
},
26+
'/zh/': {
27+
selectText: '选择语言',
28+
label: '简体中文',
29+
},
30+
},
31+
2132
// Assumes GitHub. Can also be a full GitLab url.
2233
repo: 'sqrthree/vuepress-theme-api',
2334
// Customising the header label

0 commit comments

Comments
 (0)