Skip to content
New issue

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

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

Already on GitHub? # to your account

Wrong sort return with Intl.Collator #39318

Open
NandoCabralss opened this issue Jul 9, 2021 · 2 comments
Open

Wrong sort return with Intl.Collator #39318

NandoCabralss opened this issue Jul 9, 2021 · 2 comments
Labels
i18n-api Issues and PRs related to the i18n implementation.

Comments

@NandoCabralss
Copy link

NandoCabralss commented Jul 9, 2021

Version

v14.17.0

Platform

#66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

[{'name': 'CT'}, {'name': 'CH'}].sort((a, b) => {
return new Intl.Collator('br', { numeric: true, sensitivity: 'base' }).compare(a.name, b.name)
});

Run the above command in Node 17.

How often does it reproduce? Is there a required condition?

every time.

What is the expected behavior?

Output of: [ { name: 'CH' }, { name: 'CT' } ]

(Reproduces in Node 14.16.1)

What do you see instead?

Output of: [ { name: 'CT' }, { name: 'CH' } ]

Additional information

No response

@Ayase-252 Ayase-252 added the i18n-api Issues and PRs related to the i18n implementation. label Jul 9, 2021
@NandoCabralss
Copy link
Author

NandoCabralss commented Jul 9, 2021

Update. When i use 'en' instead of 'br' it works fine. This issue only happens with 'br'. Also, this error happens with node v15.x too.

@NandoCabralss
Copy link
Author

Another update.. it's seen that 'br' only works in 14.16.x or lower. I tried 'pt-br' and works in the 14.17.x or superior.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
i18n-api Issues and PRs related to the i18n implementation.
Projects
None yet
Development

No branches or pull requests

2 participants