Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/text/language: Wrong language is selected #48324

iandees opened this issue Sep 10, 2021 · 2 comments

x/text/language: Wrong language is selected #48324

iandees opened this issue Sep 10, 2021 · 2 comments


Copy link

@iandees iandees commented Sep 10, 2021

What version of Go are you using (go version)?

$ go version
go version go1.17 darwin/amd64

Does this issue reproduce with the latest release?

Yes (via

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

I have a set of strings in Norwegian and Danish. The user requests content via Accept-Language header of nb-no (Norwegian). Example:

What did you expect to see?

I expected to get an exact match to the Norwegian language tag.

What did you see instead?

Match() picks Danish instead.

@gopherbot gopherbot added this to the Unreleased milestone Sep 10, 2021
@ALTree ALTree added the NeedsInvestigation label Sep 10, 2021
Copy link

@thanm thanm commented Sep 10, 2021


Copy link

@benthomson benthomson commented Sep 30, 2021

I second that this is causing similar issues for us. I suspect it is defaulting to Danish because Norwegian Bøkmal / Norse Bøkmal originates from Danish and there may be some logic behind the scenes to make this determination (I haven't delved into the source code to confirm this theory). Regardless adding support for this would be much appreciated as we currently having to handle locales that begin with nb as a special case and have a load of legacy issues to resolve where we have persisted references to Danish that should be Norwegian. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

5 participants