propensive / gossamer

Lightweight and typesafe strings in Scala
https://soundness.dev/gossamer/
2 stars 0 forks source link

Provide better `Text` sorting with Java's collators #8

Open propensive opened 2 years ago

propensive commented 2 years ago

Currently, sorting is done using the default Ordering[String] instance. But it should be locale-dependent, and the locale should be made explicit.

For example, for French, we currently need to write something like:

val collator = Collator.getInstance(Locale.FRANCE)
given Ordering[String] = collator.compare(_, _)
propensive commented 7 months ago

Locales should be taken from Cosmopolite.