From 2ec11bd63c85e855b6993722df26cfa02d6aa16d Mon Sep 17 00:00:00 2001 From: sqrtthree Date: Sun, 22 Jul 2018 18:15:19 +0800 Subject: [PATCH] :bug: fix: Fix "donot show multi-language options when setted the sidebarGroupOrder" error Signed-off-by: sqrtthree --- components/Sidebar/index.vue | 5 ++++- docs/.vuepress/config.js | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/components/Sidebar/index.vue b/components/Sidebar/index.vue index 2420df2..4a2467d 100644 --- a/components/Sidebar/index.vue +++ b/components/Sidebar/index.vue @@ -84,10 +84,13 @@ export default { this.$localePath ) + const langTitle = config.get(this.$site, 'selectText', this.$localePath) || 'other-languages' + if (groupOrderConfig) { const result = groupOrderConfig.slice() - result.unshift('other-languages', 'home') + result.unshift(langTitle, 'home') + return result } else { return Object.keys(this.items) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index c7a244e..777cf8e 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -18,6 +18,17 @@ module.exports = { }, }, themeConfig: { + locales: { + '/': { + selectText: 'Languages', + label: 'English', + }, + '/zh/': { + selectText: '选择语言', + label: '简体中文', + }, + }, + // Assumes GitHub. Can also be a full GitLab url. repo: 'sqrthree/vuepress-theme-api', // Customising the header label