i18next / i18next-browser-languageDetector

language detector used in browser environment for i18next
MIT License
865 stars 88 forks source link

Does not reckonize da_DK as da #252

Closed simplenotezy closed 2 years ago

simplenotezy commented 2 years ago

🐛 Bug Report / Missing feature

Given an app with two languages: da and en, if I visit the site with locale: da-DK it does not set language to da. Only if the language header is da, then it works.

Expected behavior

It should match da-DK with da, if there is no direct da-DK language already

adrai commented 2 years ago

Can you please create a reproducible example? With steps to reproduce?

Can't imagine this is not working. The only thing that could maybe influence is the wrong language code... normally it's da-DK

https://www.i18next.com/how-to/faq#how-should-the-language-codes-be-formatted

simplenotezy commented 2 years ago

Well, it does work, it sets the language to "da-DK" but it uses my fallback language which is "en", because we do not have a registered language called "da-DK", we only have a language called "da".

simplenotezy commented 2 years ago

As I was trying to create a reproducible example it worked! Not sure what went wrong.

Anyhow, case closed.

Thanks for prompt reply