At ]:
{{ro-noun|gend=n|pl=adăposturi|sort=ada{{FFFF}}post}}
In certain languages' writing systems, there exist additional letters inserted into an otherwise translingual alphabet, such as the Latin or Cyrillic alphabet. For example, in Spanish, the letter ñ comes between the letters n and o, such that (deprecated template usage) piña comes between (deprecated template usage) pinto and (deprecated template usage) piojo in alphabetical order. By default, MediaWiki won't use this correct order when listing members of a category; but it does allow an entry's "sort key" to be specified, controlling the entry's placement. (If no sort key is specified, the entry's title is used.) In an entry for a Spanish word containing ñ, the sort key should be the headword, except replacing all instances of ñ with n{{FFFF}}.
Note that this approach doesn't work for all languages; it depends on the language's traditional alphabetization scheme. In some languages, such as Swedish, the additional letters are added to the end of the alphabet; and in other languages, such as French, diacritics are mostly ignored in the traditional alphabetization scheme (such that (deprecated template usage) des and (deprecated template usage) dès are mostly equivalent: (deprecated template usage) dès follows (deprecated template usage) des, but comes before (deprecated template usage) dessiner and (deprecated template usage) detenir). Languages in which it does work include Mongolian, Romanian, Spanish, and Turkish.
{{FFFF}}
inserts a non-Unicode character, which MediaWiki sorts after all basic Unicode characters (including all Latin and Cyrillic letters); so, it's kind of like inserting a z — (deprecated template usage) pinto comes before (deprecated template usage) pinza comes before (deprecated template usage) piojo — but a bit more robust.
While I definitely appreciate the clever funkiness of this solution, wouldn't it work just as well to use a tilde (which is the last ASCII glyphic character)? (For Cyrillic characters that would work less well — for example, we'd have to replace Ө with П~ instead of with О~ — but there's probably an easier character to use for that, too.) Relatedly, the name of this template describes its implementation rather than its functionality, which strikes me as sub-ideal; if we do want to go the template route, I think it would be better to have e.g. {{ro-ă}}
, which would expand to a. —RuakhTALK 19:29, 16 September 2008 (UTC)
Out of interest, is it completely impossible to sort these by convention. I have scripts here for generating the indices that use the convention of the language to determine which order to sort letters with diacritics (writing a method to generate a sort-key from a string isn't too hard if you know what the conventions to be used are). I do know that for some languages with double-letters, like Hungarian, it is impossible for a computer to guess completely accurately how to sort the word (as cs looks like cs etc.) but I would have thought that people would be more consistent with sorting the diacritics. Conrad.Irwin 00:09, 17 September 2008 (UTC)