Page 1 of 1
Bug: words omitted for sorting ignored in daughter category
Posted: Sun Feb 06, 2011 11:34 am
by pml
The words in various languages which we normally exclude from sorting rules, e.g. A, The, La, Le, Les, Der, Die, Das, Il, and so on, do not appear to be omitted when the page in question is a member of a daughter category. For example, Les Troyens sorts under T in Berlioz’s default category: as he is also categorised as an arranger (vocal score) and librettist (author) the work however sorts under L instead of T, in the daughter categories /Arranger and /Librettist. I've noticed similar oddities with composers elsewhere, generally in daughter categories.
Naturally these problems may have gone somewhat unnoticed until multiple categories were yoked into close quarters on the one page!
Cheers, PML
Re: Bug: words omitted for sorting ignored in daughter categ
Posted: Sun Feb 06, 2011 11:48 am
by Davydov
It has been noticed and reported to Feldmahler, who was up very late last night fixing other things. I'm sure he'll get round to it
Re: Bug: words omitted for sorting ignored in daughter categ
Posted: Sun Feb 06, 2011 5:47 pm
by imslp
With great regret I announce the availability of the {{#worksortkey:}} parser function. Add it to the category inclusions in the {{Link}} templates to make it sort correctly, e.g. [[Category:Schubert, Franz{{#worksortkey:}}]].
I reserve the right to convert all {{Link}} templates into something more efficient in the future.
This is especially because there are now enough pages linked to the {{Link}} templates that changing the templates may cause a temporary overloading of the server (but then again there is no other way at the moment). Therefore, be judicious in your editing of those templates.
Re: Bug: words omitted for sorting ignored in daughter categ
Posted: Sun Feb 06, 2011 6:53 pm
by Davydov
I've just tried it on {{LinkArr}}, and it seems to work — not that there could be any serious doubt about that!
It will take time for the cache to catch up with all the links, and bearing in mind Feldmahler's comments above, we should wait a good few hours before implementing the same on {{LinkEd}}, {{LinkTr}} and {{LinkLib}}, with decent time intervals between each of them.
Re: Bug: words omitted for sorting ignored in daughter categ
Posted: Mon Feb 07, 2011 1:54 am
by pml
I just noticed Davydov created a generic version of the {{LinkX}} templates,
{{LinkName}}. I’ve added the following code included in the switch statement. It can essentially replace all five of the current templates in wide use, LinkComp/Arr/Ed/Lib/Tr:
Code: Select all
<includeonly>{{ #if: {{{2|}}} |[[:Category:{{{2}}}, {{{1}}}|{{{1}}} {{{2}}}]]|[[:Category:{{{1}}}|{{{1}}}]]}}{{ #switch: {{lc: {{{t}}} }}
|arr={{ #if: {{{2|}}} |[[Category:{{{2}}}, {{{1}}}/Arranger{{#worksortkey:}}]]|[[Category:{{{1}}}/Arranger{{#worksortkey:}}]]}}
|ed={{ #if: {{{2|}}} |[[Category:{{{2}}}, {{{1}}}/Editor{{#worksortkey:}}]]|[[Category:{{{1}}}/Editor{{#worksortkey:}}]]}}
|lib={{ #if: {{{2|}}} |[[Category:{{{2}}}, {{{1}}}/Librettist{{#worksortkey:}}]]|[[Category:{{{1}}}/Librettist{{#worksortkey:}}]]}}
|tr={{ #if: {{{2|}}} |[[Category:{{{2}}}, {{{1}}}/Translator{{#worksortkey:}}]]|[[Category:{{{1}}}/Translator{{#worksortkey:}}]]}}
|
}}</includeonly>
If only one or two standard variables are presented, it behaves like {{LinkComp}}; if a third variable
t=X is presented, where
X is one of the possible types {{ Arr | Ed | Lib | Tr }} (case insensitive) then it adds the appropriate daughter category, which is part and parcel of the variant {{LinkX}} templates.
Thus the following are equivalent:
{{LinkArr|Fred|Nerk}} and {{LinkName|t=Arr|Fred|Nerk}}; by adding [[Category:Nerk, Fred/Arranger]] (sortkey optional ;)
{{LinkEd|Fred|Nerk}} and {{LinkName|t=Ed|Fred|Nerk}}; by adding [[Category:Nerk, Fred/Editor]]
{{LinkLib|Fred|Nerk}} and {{LinkName|t=Lib|Fred|Nerk}}; by adding [[Category:Nerk, Fred/Librettist]]
{{LinkTr|Fred|Nerk}} and {{LinkName|t=Tr|Fred|Nerk}}; by adding [[Category:Nerk, Fred/Translator]]
{{LinkComp|Fred|Nerk}} and {{LinkName|Fred|Nerk}} — no category is added.
(Also note that because t is a declared variable, it can appear in any order in the template, before, after or inbetween the two name variables.)
I doubt this is the most efficient way the function may be programmed – which Edward has said he would like to reserve for his pleasure! The use of the switch is obviously extensible to cover any new types of category desired (such as Perlnerd’s suggestion of Dedicatees of compositions).
Re: Bug: words omitted for sorting ignored in daughter categ
Posted: Mon Feb 07, 2011 2:56 am
by imslp
I would love dearly to move that into FTE space. On the other hand, there are already too many moving parts, and I might wait for a week or two for the dust to settle down before doing any other massive changes. In the meanwhile the current system can be kept de facto.
Re: Bug: words omitted for sorting ignored in daughter categ
Posted: Mon Feb 07, 2011 6:42 am
by Davydov
Actually, the "LinkName" template was intended to replace "LinkComp" and used when you just wanted to mention a person and link to their home category, without defining them as composer, arranger, librettist, etc of the page from which you are linking. So {{LinkComp|Ludwig van|Beethoven}} would create a link in the form [[:Category:Beethoven, Ludwig van|Ludwig van Beethoven]]. The new modifications to the template don't seem to allow for this
Re: Bug: words omitted for sorting ignored in daughter categ
Posted: Mon Feb 07, 2011 12:04 pm
by pml
I think you misunderstand – the categories are only added in the event the switch is given a specific value, because otherwise it has a blank default (the last line of the switch). In other words, it does behave like LinkComp normally: the t variable must be added to make it behave like the other templates (LinkAdd/Ed/Lib/Tr). (Try it!)
Cheers, Philip
PS By the way, LinkComp was even more simple-minded than LinkName, before I added the switch – it was unable to cope with the name being given as a single variable (e.g. Anonymous) rather than two (e.g. {{LinkComp|Fred|Nerk}}).