Skip to content

Commit c046905

Browse files
committed
fix(search): correctly detect multilang
Close #316
1 parent 5c076f4 commit c046905

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/client/theme-default/Layout.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ const isCustomLayout = computed(() => !!frontmatter.value.customLayout)
3131
// home
3232
const enableHome = computed(() => !!frontmatter.value.home)
3333
34+
// automatic multilang check for AlgoliaSearchBox
35+
const isMultiLang = computed(
36+
() => Object.keys(theme.value.locales || {}).length > 0
37+
)
38+
3439
// navbar
3540
const showNavbar = computed(() => {
3641
const themeConfig = theme.value
@@ -85,7 +90,7 @@ const pageClasses = computed(() => {
8590
<AlgoliaSearchBox
8691
v-if="theme.algolia"
8792
:options="theme.algolia"
88-
:multilang="!!theme.locales"
93+
:multilang="isMultiLang"
8994
:key="site.lang"
9095
/>
9196
</slot>

0 commit comments

Comments
 (0)