kubernetes / kubernetes/website
Kubernetes Documentation: Please observe Accept-Language on search
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 15.7k
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 204
Description
I just hit `https://kubernetes.io/search/?q=hostname` and got a pile of results including several Japanese results amongst a flurry of English. Most notably, the *top* result was in Japanese. When I did this at the office, just about *all* search results were in Japanese.
While I live and work in Japan, I have instructed my web browsers to send an `Accept-Language` header that states that I want English at home. At the office I prefer English but can live with Japanese. It would be nice if your search functionality actually respected that. Just because the request is coming from an IP address that is ostensibly in Japan doesn't mean a user wants Japanese.
For the record, the header used when hitting the URL above from home was `Accept-Language: en-US,en;q=0.5`.
:thinking: Maybe I should jack up that `q` value.
Here's the full request with all headers.
```
GET /search/?q=hostname HTTP/2
Host: kubernetes.io
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://kubernetes.io/search/?q=host
DNT: 1
Connection: keep-alive
Cookie: is_china=false
Upgrade-Insecure-Requests: 1
Sec-GPC: 1
If-None-Match: "8f8033b5be53a0211529ab54d3c57f93-ssl-df"
TE: Trailers
```
Contributor guide
Research direction
Start by reproducing the behavior at https://kubernetes.io/search/?q=hostname with the provided Accept-Language header and inspect the website search entry point. Trace how locale selection affects returned results; done means English-preferred requests no longer receive Japanese results solely because of the requester’s apparent location, with appropriate coverage added where the search behavior is tested.
Written by the indexing model from the issue text.
Assessment
- Domain
- internationalization, search, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100