cli icon indicating copy to clipboard operation
cli copied to clipboard

Add locale option and sort using locale (closes #349)

Open SmallhillCZ opened this issue 2 years ago • 2 comments

What: Sorting is made to be locale aware

Why: sorting of non-ACII languages does not work correctly, see #349

How:

  • contributorsSortLocale option is added to CLI to control which locale is going to be used for alphabetic sorting
  • alphabetic sorting is done using String.localeCompare instead of _.sortBy to enable locale aware sorting

Checklist:

  • [ ] Documentation
  • [ ] Tests
  • [ ] Ready to be merged
  • [ ] Added myself to contributors table

TODOs:

  1. husky git hook forces some whitespace changes by running prettier, is that correct?
  2. can't find the documentation to add this into, is it meant to do another PR for the website?
  3. there is a test for sorting already, is that enough, or should I create a special test for different locale?

SmallhillCZ avatar Jan 27 '23 13:01 SmallhillCZ

husky git hook forces some whitespace changes by running prettier, is that correct?

Nope, aside from when the lines are too long (since there's a max length for rows).

can't find the documentation to add this into, is it meant to do another PR for the website?

Yeah, the docs are in https://github.com/all-contributors/all-contributors.

there is a test for sorting already, is that enough, or should I create a special test for different locale?

Yes, please.

Berkmann18 avatar May 19 '23 18:05 Berkmann18

Thanks, I will have a look into this next month, this one is too full already ;)

SmallhillCZ avatar May 20 '23 16:05 SmallhillCZ