Describe the bug
Automatic language detection recently got broken in my project.
To Reproduce
Steps to reproduce the behavior:
- Browser sends
Accept-Language: en-GB,en;q=0.5
- i18n chooses to display
ga
Expected behavior
Since both en-GB and en are supplied, and en is available as a folder (and not missing any translations), en should be chosen in my eyes.
ga is missing some strings, so English is used for them instead.
Desktop (please complete the following information):
- OS: Debian GNU/Linux 11
- Go version: go1.19.3
Additional context
Add any other context about the problem here.
file structure of locales
locales/
locales/nl
locales/nl/base.yaml
locales/da
locales/da/base.yaml
locales/en
locales/en/other-component.yaml
locales/en/base.yaml
locales/ga
locales/ga/base.yaml
locales/pl
locales/pl/base.yaml
locales/fr
locales/fr/base.yaml
locales/de
locales/de/other-component.yaml
locales/de/base.yaml
Further notes
- I cannot find any other indicators for languages. There is no "lang" cookie. There is no request GET parameter. Hostname is "localhost".
- code excerpt (registering API method, I did no further interaction with your library AFAICS)
locale := i18n.GetLocale(r)
templateData["tr"] = locale.GetMessage
It works in another browser where I send Accept-Language: de,en-US;q=0.7,en;q=0.3 (de is chosen / displayed).
Appreciate your help :) Thank you!
Describe the bug
Automatic language detection recently got broken in my project.
To Reproduce
Steps to reproduce the behavior:
Accept-Language: en-GB,en;q=0.5gaExpected behavior
Since both en-GB and en are supplied, and en is available as a folder (and not missing any translations), en should be chosen in my eyes.
gais missing some strings, so English is used for them instead.Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
file structure of locales
Further notes
gais default, unlessdeis chosen.It works in another browser where I send
Accept-Language: de,en-US;q=0.7,en;q=0.3(deis chosen / displayed).Appreciate your help :) Thank you!