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

Open
iandees opened this issue Sep 10, 2021 · 2 comments
Open

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

iandees opened this issue Sep 10, 2021 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@iandees
Copy link

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 play.golang.org)

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

go env Output
$ go env
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"

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:

https://play.golang.org/p/rfr4sjGVHkk

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 Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 10, 2021
@thanm
Copy link
Contributor

thanm commented Sep 10, 2021

@mpvl

@benthomson
Copy link

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
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants