Conversation
fabpot
left a comment
There was a problem hiding this comment.
Why not reuse the existing sort filter? Something like values|sort(locale: 'fr').
I understand that sort is in Twig core, while locale-aware collation needs PHP’s
optional Intl extension. But it's peobably manageable if Intl is required only when locale is supplied.
fabpot
left a comment
There was a problem hiding this comment.
Why not reuse the existing sort filter? Something like values|sort(locale: 'fr').
I understand that sort is in Twig core, while locale-aware collation needs PHP’s
optional Intl extension. But it's peobably manageable if Intl is required only when locale is supplied.
1434265 to
7cf559f
Compare
I was thinking of something where the |
7cf559f to
4accd09
Compare
1776014 to
c10e1ff
Compare
c10e1ff to
8758930
Compare
The
sortfilter compares strings byte per byte, which sorts uppercase letters before lowercase ones and accented letters afterz, so it cannot sort text the way a reader expects:This adds a
sort_localizedfilter totwig/intl-extra, which sorts sequences and mappings with the collation rules of a locale:sort.cities|sort_localized(city => city.name).