From: Tim Starling Date: Sat, 28 Feb 2004 14:34:13 +0000 (+0000) Subject: Improved [[MediaWiki:All messages]] table X-Git-Tag: 1.3.0beta1~913 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22lang_raccourcis%22%2C%22module=%24nom_module%22%29%20.%20%22?a=commitdiff_plain;h=cc02c684f00678db05650f30cb1708975151c9c7;p=lhc%2Fweb%2Fwiklou.git Improved [[MediaWiki:All messages]] table --- diff --git a/maintenance/InitialiseMessages.inc b/maintenance/InitialiseMessages.inc index 6da89df8f5..67c24c136c 100755 --- a/maintenance/InitialiseMessages.inc +++ b/maintenance/InitialiseMessages.inc @@ -12,7 +12,8 @@ function initialiseMessages( $overwrite = false) { $timestamp = wfTimestampNow(); $invTimestamp = wfInvertTimestamp( $timestamp ); - $navText = wfMsgNoDB( "allmessagestext" ); + $mwMsg =& MagicWord::get( MAG_MSG ); + $navText = str_replace( "$1", "allmessagestext", $mwMsg->getSynonym( 0 ) ); $navText .= " "; } - print "Done\n"; - print "Writing..."; if ( !$first ) { wfQuery( $sql, DB_WRITE, $fname ); } - print "Done\n"; $navText .= "
@@ -29,7 +30,7 @@ function initialiseMessages( $overwrite = false) { $first = true; $sortedArray = $wgAllMessagesEn; ksort( $sortedArray ); - + foreach ( $sortedArray as $key => $enMsg ) { if ( $first ) { $first = false; @@ -43,28 +44,22 @@ function initialiseMessages( $overwrite = false) { $sql .= "'$enctitle'"; } $sql .= ")"; - print "Reading..."; $res = wfQuery( $sql, DB_READ ); - print "."; $row = wfFetchObject( $res ); - print "done\n"; - print "Setting up..."; $exists = array(); while ( $row ) { $exists[$row->cur_title] = 1; $row = wfFetchObject( $res ); } - print "."; $sql = "INSERT INTO cur (cur_namespace, cur_title, cur_text, cur_user_text, cur_timestamp, cur_restrictions, cur_is_new, inverse_timestamp, cur_touched) VALUES "; $first = true; $mwObj =& MagicWord::get( MAG_MSGNW ); $msgnw = $mwObj->getSynonym( 0 ); - print "Done\n"; - - print "Processing..."; + $talk = $wgLang->getNsText( NS_TALK ); + $mwtalk = $wgLang->getNsText( NS_MEDIAWIKI_TALK ); foreach ( $sortedArray as $key => $enMsg ) { $message = wfMsgNoDB( $key ); @@ -102,21 +97,19 @@ function initialiseMessages( $overwrite = false) { $message = wfEscapeWikiText( $message ); $navText .= "
- [$wgServer$wgScript?title=MediaWiki:$title&action=edit $key] + [$wgServer$wgScript?title=MediaWiki:$title&action=edit $key]
+ [[$mwtalk:$title|$talk]]
$message $mw
"; @@ -125,12 +118,10 @@ function initialiseMessages( $overwrite = false) { $wgArticle = new Article( $titleObj ); $wgOut->disable(); $wgUser = User::newFromName( 'MediaWiki default' ); - print "Writing to " . $titleObj->getPrefixedDBkey() . "\n"; if ( $titleObj->getArticleID() ) { $wgArticle->updateArticle( $navText, '', 0, 0 ); } else { $wgArticle->insertNewArticle( $navText, '', 0, 0 ); } - print "Finished\n"; }