Skip to content

Commit

Permalink
fix: search for locales
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 18, 2018
1 parent bccddbf commit 4cf1232
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/default-theme/SearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,9 @@ export default {
},
methods: {
getPageLocalePath (page) {
const { locales } = this.$site
for (let i = 0; i < locales.length; i++) {
const localePath = locales[i].path
for (const localePath in this.$site.locales || {}) {
if (localePath !== '/' && page.path.indexOf(localePath) === 0) {
return locales[i].path
return localePath
}
}
return '/'
Expand Down

0 comments on commit 4cf1232

Please sign in to comment.