11<script setup lang="ts">
22const { language, country } = useLocalization ()
33const localePath = useLocalePath ()
4- const { t, locale } = useI18n ()
4+ const { locale } = useI18n ()
55
66const query = ref (' ' )
77const open = ref (false )
@@ -62,15 +62,15 @@ const { data, status } = await useStorefrontData(`search-${query.value ?? 'none'
6262const groups = computed (() => [
6363 {
6464 id: ' queries' ,
65- label: t (' search.queries' ),
65+ label: $ t (' search.queries' ),
6666 items: data .value ?.predictiveSearch ?.queries .map (predictedQuery => ({
6767 label: predictedQuery .text ,
6868 onSelect : () => query .value = predictedQuery .text ,
6969 })),
7070 },
7171 {
7272 id: ' products' ,
73- label: t (' search.products' ),
73+ label: $ t (' search.products' ),
7474 items: flattenConnection (data .value ?.products ).map (product => ({
7575 label: product .title ,
7676 suffix: product .description ,
@@ -84,7 +84,7 @@ const groups = computed(() => [
8484 },
8585 {
8686 id: ' collections' ,
87- label: t (' search.collections' ),
87+ label: $ t (' search.collections' ),
8888 items: flattenConnection (data .value ?.collections ).map (collection => ({
8989 label: collection .title ,
9090 suffix: collection .description ,
@@ -94,7 +94,7 @@ const groups = computed(() => [
9494 },
9595 {
9696 id: ' articles' ,
97- label: t (' search.articles' ),
97+ label: $ t (' search.articles' ),
9898 items: flattenConnection (data .value ?.articles ).map (article => ({
9999 label: article .title ,
100100 suffix: article .excerpt ?? undefined ,
@@ -110,20 +110,20 @@ const updateQuery = debounce((value: string) => query.value = value, 300)
110110<template >
111111 <UModal
112112 v-model:open =" open"
113- :title =" t('search.label')"
114- :description =" t('search.description')"
113+ :title =" $ t('search.label')"
114+ :description =" $ t('search.description')"
115115 >
116116 <UButton
117117 icon =" i-lucide-search"
118118 variant =" ghost"
119119 color =" neutral"
120- :label =" t('search.label')"
120+ :label =" $ t('search.label')"
121121 />
122122
123123 <template #content >
124124 <UCommandPalette
125125 :loading =" status === 'pending'"
126- :placeholder =" t('search.placeholder')"
126+ :placeholder =" $ t('search.placeholder')"
127127 :groups =" groups"
128128 :close =" true"
129129 @update:search-term =" updateQuery"
0 commit comments