vapor / docs

📖 Documentation markdown for all Vapor packages.

Home Page:https://docs.vapor.codes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search contains English content from non-English site translations

danpalmer opened this issue · comments

Describe the bug

While using search it is easy to end up on a version of the docs site in a different language.

This happens for two reasons:

  1. Search results contain content from all languages, regardless of the user's language (or language of the current site).
  2. Many documents appear in search results in English in the translated versions of the site.

While I don't think (1) is a good idea, I could see how this may be intended behaviour, as it may make it easier for non-English speaking users who land on the English site (replace for any other languages) to make their way into their desired site language just via search, rather than via the language menu.

I also understand that (2) may be intended behaviour while docs have yet to be translated, as having an English doc (or other original language) may be better than having a missing doc.

However, the product of these two decisions/bugs/factors is that it is possible to use Search in English, and end up on a different language site unintentionally. Anecdotally, this happens to me a lot.

To Reproduce

  1. Go to https://docs.vapor.codes/
  2. Search for "docker"
  3. Observe 5 results titled "Docker Deploys"
  4. Click on a result other than the first
  5. Observe that the site is no longer in English

Expected behaviour

  • At step (3), I would expect that there is only a single result for the "Docker Deploys" page.
  • At step (5), having followed that single hit, I would expect the site to be in English (or the original browsing language).

I haven't managed to reproduce this in a case where the top hit has not been English, however given the anecdotal frequency of hitting this issue I feel there may be cases of it, or at least the UX of the search is such that clicking on subsequent hits is too easy.

Environment

N/A. I can provide browser details if necessary but I don't think this is a browser compatibility bug.

Ah yeah this is caused by the localisation plugin and search plugin not working together nicely. Our workaround previously has been to remove the other languages from the search index for now but we're added a load of new languages recently and forget to tidy up the search index

Thanks! 🎉