create-t3-app icon indicating copy to clipboard operation
create-t3-app copied to clipboard

bug: docs - algolia searches english site in all languages

Open c-ehrlich opened this issue 2 years ago • 3 comments

Provide environment information

.

Describe the bug

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

engpt

To reproduce

  • go to https://create.t3.gg/pt/introduction (or any other non english docs page)
  • use the search

Additional information

No response

c-ehrlich avatar Dec 11 '22 12:12 c-ehrlich

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

juliusmarminge avatar Jan 04 '23 11:01 juliusmarminge

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 :)

c-ehrlich avatar Jan 05 '23 01:01 c-ehrlich

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?

gcavanunez avatar Feb 17 '23 13:02 gcavanunez