t3-oss / create-t3-app

The best way to start a full-stack, typesafe Next.js app
https://create.t3.gg
MIT License
25.15k stars 1.15k forks source link

bug: docs - algolia searches english site in all languages #956

Open c-ehrlich opened 1 year ago

c-ehrlich commented 1 year ago

Provide environment information

.

Describe the bug

The search widget currently searches the English site, no matter which language is set.

engpt

To reproduce

Additional information

No response

juliusmarminge commented 1 year ago

Do you know how to set this up in Algolia for it to index properly?

c-ehrlich commented 1 year ago

Astro docs have it so we could take a look at what they're doing. I'm still traveling rn but if this is still open a week or two from now I'll take it on :)

gcavanunez commented 1 year ago

Was trying to tackle this issue, from what I could gather, though the astro docs have a nice abstraction over the translations for the modal itself, the magic happens here in this DocSearch.tsx file

Particularly this line here

searchParameters={{ facetFilters: [[`lang:${lang}`]] }}

Running it locally however only works if passing the en, thus was wondering, are the docs only being indexed in english?