Change the default collation from strtoupper to Language::uc, so that non-ascii characters get to play too.

I know the uppercase thing is just a standby until a real collation function is written. However in the
mean time, i think it'd be really weird for a wiki with $wgCapitalLinks = false to suddenly have
[[a]] and [[A]] sort under the same letter in a category page, but [[Ä]] and [[ä]] sort no where
near each other, even though on a capitalized wiki they would be the same page.

See discussion on r69816.

Also fix an issue with maintenance/updateCollation.php, where php thinks
that 'uppercase' == 0 (?!). I don't really know what the deal with that
is, but using a ! instead of == 0 seems to fix it. (Follow-up r69961)
This commit is contained in:
Brian Wolff 2011-01-17 06:27:49 +00:00
parent aa9b9527b9
commit c79b4bdd21
3 changed files with 5 additions and 5 deletions

View file

@ -4616,10 +4616,10 @@ $wgCategoryPagingLimit = 200;
* for all rows where cl_collation != $wgCategoryCollation and regenerates
* cl_sortkey based on the page name and cl_sortkey_prefix.
*
* Currently only supports 'uppercase', which just uppercases the string. This
* Currently only supports 'uppercase2', which just uppercases the string. This
* is a dummy collation, to be replaced later by real ones.
*/
$wgCategoryCollation = 'uppercase';
$wgCategoryCollation = 'uppercase2';
/** @} */ # End categories }

View file

@ -3010,7 +3010,7 @@ class Language {
*/
public function convertToSortkey( $string ) {
# Fake function for now
return strtoupper( $string );
return $this->uc( $string );
}
/**
@ -3040,6 +3040,6 @@ class Language {
if ( $string[0] == "\0" ) {
$string = substr( $string, 1 );
}
return strtoupper( $this->firstChar( $string ) );
return $this->uc( $this->firstChar( $string ) );
}
}

View file

@ -80,7 +80,7 @@ TEXT;
$dbw->begin();
foreach ( $res as $row ) {
$title = Title::newFromRow( $row );
if ( $row->cl_collation == 0 ) {
if ( !$row->cl_collation ) {
# This is an old-style row, so the sortkey needs to be
# converted.
if ( $row->cl_sortkey == $title->getText()