https://bugs.freedesktop.org/show_bug.cgi?id=64176
--- Comment #9 from Tristan Van Berkom <tristan.van.berkom(a)gmail.com> ---
(In reply to comment #8)
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> [...]
> > >
> > > The idea is that "phonebook" collation is a preference that is
either
> > > available under the current locale, or not.
> > >
> > > When a locale change has been detected, the sort keys will be generated
> > > under the "phonebook" collation of the new locale... this will
fallback
> > > to the default ICU rules for the given locale if "phonebook"
tailoring
> > > is not available.
> >
> > So the "phonebook" keyword is just a hint that this field is meant to
be
> > sorted according to phone book rules if applicable? Is there value in having
> > to configure this, instead of hard-coding it for each field? Well, perhaps,
> > because then it can be enabled for other fields, too, without having to
> > modify the source code.
>
> I'm asking myself the opposite question actually.
>
> Does it make sense to assume that an addressbook should be sorted
> using "phonebook" rules ? and apply that everywhere ?
I am less sure whether it should be applied to non-name fields. Not that
sorting by address is useful, but in theory it is possible.
But in general I agree, always using "phonebook" (in de and fi) and
"pinyin"
(in China) sounds right.
The only reason for making it configurable is to accomodate for personal
user preferences (both Pinyin and non-Pinyin sorting are valid), which (as
far as I can tell) is not a useful use case (because Pinyin is sufficiently
popular, and explaining to the user that they have the choice is too
confusing).
> > I don't see much value in being able to turn off "phonebook" for
name
> > fields, though.
> >
> > How would this work for Pinyin? In other words, what would
> > CollationFields=family_name,pinyin:given_name,pinyin do when switching from
> > zn_CN (where Pinyin is expected) to de_DE (where phone book is execpted)?
>
> If "pinyin" was explicitly specified as the collation rule for a given
> field, then "phonebook" would definitely not be expected for de_DE.
Then that's where configuring the collation in the source config breaks
down, because we don't have some entity which would rewrite the config when
the locale changes - other than EDS itself, of course. And if EDS rewrites
the config, the option becomes useless.
I'm not convinced of that, from what I understand your requirements
are described by ICU as "phonebook" order, where "phonebook" order
does not exist in 'zh' locales, and the the default in 'zh' locales
is already "pinyin" (if your requirement was instead "pinyin", then
you would not expect "phonebook" order in de_DE locale at all).
It may even be that one day "phonebook" order is added to 'zh' locales,
in which case you would want to automatically benefit from the new
"phonebook" tailoring (in whichever locale which it get's added to).
Anyway, this discussion is not prodictive if we just have two sets
of opinions, so let's try to be more productive.
My perspective here is that you have a list of expected behaviours,
and I'm just not convinced that the expected behaviors for you,
are going to be the same as every other expected behavior of EDS
(which is why I think it would be safer to have something configurable,
which would probably be easier to convince upstream EDS to accept).
If the expected behaviours are indeed universal, or if we have some
very good arguments at least as to why these expected behaviours would be
universal for anything that sorts 'person names' in the context of an
'addressbook', then there may be a chance I can sell this hard coded
list to upstream.
In any case, I could start taking down a list of what collation rule
you want to be effective for which language code / country code, I'm
just not convinced that this approach is appropriate for EDS, or if
we can land it upstream this way.
> > It looks to me that "phonebook" in EDS should be
merely a flag for certain
> > fields which inside EDS gets translated into a suitable (hard-coded?!)
> > collation per current locale (ICU "phonebook" in de and fi, ICU
"pinyin" in
> > Chinese locales). See also bug #64173.
> >
> > Note that Pinyin may require additional work, see bug #64173 comment #3.
>
> Nod, also indexing anything by first letter/character seems to need the same
> type of attention, there is AlphabetIndex which can be used for this:
>
www.icu-project.org/apiref/icu4c/classicu_1_1AlphabeticIndex.html
>
> My thoughts on this are, for sorting, one could use 2 sort keys for any
> given field, the primary sort key would be the 'bucket' (character) which a
> given word falls under according to AlphabetIndex, and the actual sort key
> of the word would be the secondary sort key.
>
> This would also require some API churn at higher levels, i.e. any view
> which wants to display a sorted list with letter/character grouping, would
> need to first query the addressbook to know which characters are valid
> for the current locale (and in what order those groups should be displayed).
This grouping is a separate problem. Let's keep it out of the discussion for
now.
(In reply to comment #8)
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> [...]
> > >
> > > The idea is that "phonebook" collation is a preference that is
either
> > > available under the current locale, or not.
> > >
> > > When a locale change has been detected, the sort keys will be generated
> > > under the "phonebook" collation of the new locale... this will
fallback
> > > to the default ICU rules for the given locale if "phonebook"
tailoring
> > > is not available.
> >
> > So the "phonebook" keyword is just a hint that this field is meant to
be
> > sorted according to phone book rules if applicable? Is there value in having
> > to configure this, instead of hard-coding it for each field? Well, perhaps,
> > because then it can be enabled for other fields, too, without having to
> > modify the source code.
>
> I'm asking myself the opposite question actually.
>
> Does it make sense to assume that an addressbook should be sorted
> using "phonebook" rules ? and apply that everywhere ?
I am less sure whether it should be applied to non-name fields. Not that
sorting by address is useful, but in theory it is possible.
But in general I agree, always using "phonebook" (in de and fi) and
"pinyin"
(in China) sounds right.
The only reason for making it configurable is to accomodate for personal
user preferences (both Pinyin and non-Pinyin sorting are valid), which (as
far as I can tell) is not a useful use case (because Pinyin is sufficiently
popular, and explaining to the user that they have the choice is too
confusing).
> > I don't see much value in being able to turn off "phonebook" for
name
> > fields, though.
> >
> > How would this work for Pinyin? In other words, what would
> > CollationFields=family_name,pinyin:given_name,pinyin do when switching from
> > zn_CN (where Pinyin is expected) to de_DE (where phone book is execpted)?
>
> If "pinyin" was explicitly specified as the collation rule for a given
> field, then "phonebook" would definitely not be expected for de_DE.
Then that's where configuring the collation in the source config breaks
down, because we don't have some entity which would rewrite the config when
the locale changes - other than EDS itself, of course. And if EDS rewrites
the config, the option becomes useless.
>
I'm not convinced of that, from what I understand your requirements
are described by ICU as "phonebook" order, where "phonebook" order
does not exist in 'zh' locales, and the the default in 'zh' locales
is already "pinyin" (if your requirement was instead "pinyin", then
you would definitely not expect "phonebook" order in de_DE locale at
all).
It may even be that one day "phonebook" order is added to 'zh' locales,
in which case you would want to automatically benefit from the new
"phonebook" tailoring (in whichever locale which it get's added to).
Anyway, this discussion is not prodictive if we just have two sets
of opinions, so I'll try to be more productive and to the point.
My perspective here is that you have a list of expected behaviours,
and I'm just not convinced that the expected behaviors for you,
are going to be the same as every other expected behavior of EDS
(which is why I think it would be safer to have something configurable,
which would probably be easier to convince upstream EDS to accept).
If the expected behaviours are indeed universal, or if we have some
very good arguments at least as to why these expected behaviours would be
universal for anything that sorts 'person names' in the context of an
'addressbook', then there may be a chance I can sell this hard coded
list to upstream.
In any case, I could start taking down a list of what collation rule
you want to be effective for which language code / country code, I'm
just not convinced that this approach is appropriate for EDS, or if
we can land it upstream this way.
> > It looks to me that "phonebook" in EDS should be
merely a flag for certain
> > fields which inside EDS gets translated into a suitable (hard-coded?!)
> > collation per current locale (ICU "phonebook" in de and fi, ICU
"pinyin" in
> > Chinese locales). See also bug #64173.
> >
> > Note that Pinyin may require additional work, see bug #64173 comment #3.
>
> Nod, also indexing anything by first letter/character seems to need the same
> type of attention, there is AlphabetIndex which can be used for this:
>
www.icu-project.org/apiref/icu4c/classicu_1_1AlphabeticIndex.html
>
> My thoughts on this are, for sorting, one could use 2 sort keys for any
> given field, the primary sort key would be the 'bucket' (character) which a
> given word falls under according to AlphabetIndex, and the actual sort key
> of the word would be the secondary sort key.
>
> This would also require some API churn at higher levels, i.e. any view
> which wants to display a sorted list with letter/character grouping, would
> need to first query the addressbook to know which characters are valid
> for the current locale (and in what order those groups should be displayed).
This grouping is a separate problem. Let's keep it out of the discussion for
now.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.