Skip to content

Commit acb37b3

Browse files
author
reco_luan
committed
fix(vuepress-theme-reco): fix multi-language configuration err
ISSUES CLOSED: #229
1 parent 84e9516 commit acb37b3

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

packages/vuepress-theme-reco/mixins/locales.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@ import { zhHans, zhHant, en, ja, ko } from '../locales/index'
33
export default {
44
computed: {
55
$recoLocales () {
6-
const recoLocales = this.$themeLocaleConfig.recoLocales
7-
if (recoLocales && recoLocales.homeBlog) {
8-
return { homeBlog: recoLocales.homeBlog }
9-
}
6+
const recoLocales = this.$themeLocaleConfig.recoLocales || {}
7+
108
if (/^zh\-(CN|SG)$/.test(this.$lang)) {
11-
return zhHans
9+
return { ...zhHans, ...recoLocales }
1210
}
1311
if (/^zh\-(HK|MO|TW)$/.test(this.$lang)) {
14-
return zhHant
12+
return { ...zhHant, ...recoLocales }
1513
}
1614
if (/^ja\-JP$/.test(this.$lang)) {
17-
return ja
15+
return { ...ja, ...recoLocales }
1816
}
1917
if (/^ko\-KR$/.test(this.$lang)) {
20-
return ko
18+
return { ...ko, ...recoLocales }
2119
}
22-
return en
20+
return { ...en, ...recoLocales }
2321
}
2422
}
2523
}

0 commit comments

Comments
 (0)