Skip to content

Commit 4cf1232

Browse files
committed
fix: search for locales
1 parent bccddbf commit 4cf1232

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/default-theme/SearchBox.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,9 @@ export default {
9292
},
9393
methods: {
9494
getPageLocalePath (page) {
95-
const { locales } = this.$site
96-
for (let i = 0; i < locales.length; i++) {
97-
const localePath = locales[i].path
95+
for (const localePath in this.$site.locales || {}) {
9896
if (localePath !== '/' && page.path.indexOf(localePath) === 0) {
99-
return locales[i].path
97+
return localePath
10098
}
10199
}
102100
return '/'

0 commit comments

Comments
 (0)