Comment # 6
on bug 64176
from Patrick Ohly
(In reply to comment #5)
> > > My work-in-progress branch will eventually add the option to
> > > set collation types for some fields, for example to set "phonebook"
> > > collation on given_name and family_name, the configuration looks like this:
> > >
> > > CollationFields=family_name,phonebook:given_name,phonebook
> >
> > I doubt that this will be practical. Choosing the "phonebook" collation only
> > makes sense in some locales. Who decides to add "phonebook" in the EDS
> > source config and when?
> >
> > What happens if the user changes the locale from one where "phonebook" is
> > right to one where it is not?
> >
> > IMHO, overriding the default collation belongs into an additional env
> > variable that then gets changed together with the LANG/LC_ env variables.
> >
> > In the meantime, EDS should hard-code sane defaults for several "relevant"
> > locales.
>
> 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 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)?
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.