From: Zheng Zhu Date: Fri, 24 Sep 2004 18:24:01 +0000 (+0000) Subject: Attempt to fix links not fixed in the wgLang->wgContLang transition X-Git-Tag: 1.5.0alpha1~1819 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=2d244b91f77016c31eed2e93c9dd202c84f07491;p=lhc%2Fweb%2Fwiklou.git Attempt to fix links not fixed in the wgLang->wgContLang transition --- diff --git a/includes/Credits.php b/includes/Credits.php index 1a9462a26f..822805254e 100644 --- a/includes/Credits.php +++ b/includes/Credits.php @@ -168,9 +168,9 @@ function getContributorCredits($article, $cnt, $showIfMax) { * */ function creditLink($user_name, $link_text = '') { - global $wgUser, $wgLang; + global $wgUser, $wgContLang; $skin = $wgUser->getSkin(); - return $skin->makeLink($wgLang->getNsText(NS_USER) . ':' . $user_name, + return $skin->makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name, (empty($link_text)) ? $user_name : $link_text); } diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 3f21307dd8..0bb6b147b2 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -529,7 +529,7 @@ class OutputPage { $this->mBodytext = ''; $sk = $wgUser->getSkin(); - $ap = $sk->makeKnownLink( wfMsg( 'administrators' ), '' ); + $ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ), '' ); $this->addHTML( wfMsg( 'sysoptext', $ap ) ); $this->returnToMain(); } @@ -544,7 +544,7 @@ class OutputPage { $this->mBodytext = ''; $sk = $wgUser->getSkin(); - $ap = $sk->makeKnownLink( wfMsg( 'administrators' ), '' ); + $ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ), '' ); $this->addHTML( wfMsg( 'developertext', $ap ) ); $this->returnToMain(); } @@ -669,7 +669,7 @@ class OutputPage { $sk = $wgUser->getSkin(); if ( '' == $returnto ) { - $returnto = wfMsg( 'mainpage' ); + $returnto = wfMsgForContent( 'mainpage' ); } $link = $sk->makeKnownLink( $returnto, '' ); diff --git a/includes/Parser.php b/includes/Parser.php index c575cdab0b..823748ea74 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -919,7 +919,7 @@ class Parser wfProfileIn( $fname ); $sk =& $this->mOptions->getSkin(); - $linktrail = wfMsg('linktrail'); + $linktrail = wfMsgForContent('linktrail'); $bits = preg_split( EXT_LINK_BRACKETED, $text, -1, PREG_SPLIT_DELIM_CAPTURE ); $s = $this->replaceFreeExternalLinks( array_shift( $bits ) ); diff --git a/includes/Skin.php b/includes/Skin.php index 65677c1501..6653572394 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -585,7 +585,10 @@ class Skin { $action = $wgRequest->getText( 'action' ); $s = $this->printableLink(); - if ( wfMsg ( 'disclaimers' ) != '-' ) $s .= ' | ' . $this->makeKnownLink( wfMsg( 'disclaimerpage' ), wfMsg( 'disclaimers' ) ) ; + if ( wfMsg ( 'disclaimers' ) != '-' ) + $s .= ' | ' . $this->makeKnownLink( + wfMsgForContent( 'disclaimerpage' ), + wfMsg( 'disclaimers' ) ) ; if ( $wgOut->isArticleRelated() ) { if ( $wgTitle->getNamespace() == Namespace::getImage() ) { @@ -761,7 +764,7 @@ class Skin { "returnto={$rt}" ) . ' | ' . $this->specialLink( 'preferences' ); } - $s .= ' | ' . $this->makeKnownLink( wfMsg( 'helppage' ), + $s .= ' | ' . $this->makeKnownLink( wfMsgForContent( 'helppage' ), wfMsg( 'help' ) ); return $s; @@ -981,7 +984,8 @@ class Skin { } // only show watchlist link if logged in - if ( wfMsg ( 'currentevents' ) != '-' ) $s .= $sep . $this->makeKnownLink( wfMsg( 'currentevents' ), '' ) ; + if ( wfMsg ( 'currentevents' ) != '-' ) + $s .= $sep . $this->makeKnownLink( wfMsgForContent( 'currentevents' ), '' ) ; $s .= "\n

"; $articleExists = $wgTitle->getArticleId(); if ( $wgOut->isArticle() || $action =='edit' || $action =='history' || $wpPreview) { @@ -1142,26 +1146,27 @@ class Skin { } function mainPageLink() { - $mp = wfMsg( 'mainpage' ); - $s = $this->makeKnownLink( $mp, $mp ); + $mp = wfMsgForContent( 'mainpage' ); + $mptxt = wfMsg( 'mainpage'); + $s = $this->makeKnownLink( $mp, $mptxt ); return $s; } function copyrightLink() { - $s = $this->makeKnownLink( wfMsg( 'copyrightpage' ), + $s = $this->makeKnownLink( wfMsgForContent( 'copyrightpage' ), wfMsg( 'copyrightpagename' ) ); return $s; } function aboutLink() { - $s = $this->makeKnownLink( wfMsg( 'aboutpage' ), + $s = $this->makeKnownLink( wfMsgForContent( 'aboutpage' ), wfMsg( 'aboutsite' ) ); return $s; } function disclaimerLink() { - $s = $this->makeKnownLink( wfMsg( 'disclaimerpage' ), + $s = $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ), wfMsg( 'disclaimers' ) ); return $s; } @@ -1349,7 +1354,7 @@ class Skin { } function bugReportsLink() { - $s = $this->makeKnownLink( wfMsg( 'bugreportspage' ), + $s = $this->makeKnownLink( wfMsgForContent( 'bugreportspage' ), wfMsg( 'bugreports' ) ); return $s; } @@ -2629,7 +2634,7 @@ class Skin { $thelink = $this->makeMediaLink( $submatch[1], "", $text ); } else { # Other kind of link - if( preg_match( wfMsg( "linktrail" ), $match[4], $submatch ) ) { + if( preg_match( wfMsgForContent( "linktrail" ), $match[4], $submatch ) ) { $trail = $submatch[1]; } else { $trail = ""; diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index 75417fe985..c25da6bfc9 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -42,7 +42,7 @@ class ListUsersPage extends QueryPage { $name = $skin->makeLink( $wgContLang->getNsText($result->namespace) . ':' . $result->title, $result->title ); if( '' != $result->type ) { $name .= ' (' . - $skin->makeLink( wfMsg( "administrators" ), $result->type) . + $skin->makeLink( wfMsgForContent( "administrators" ), $result->type) . ')'; } return $name; diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 1b2e907b9a..3cfa4a0839 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -356,7 +356,7 @@ class UploadForm { $fd = wfMsg( 'filedesc' ); $ulb = wfMsg( 'uploadbtn' ); - $clink = $sk->makeKnownLink( wfMsg( 'copyrightpage' ), + $clink = $sk->makeKnownLink( wfMsgForContent( 'copyrightpage' ), wfMsg( 'copyrightpagename' ) ); $ca = wfMsg( 'affirmation', $clink ); $iw = wfMsg( 'ignorewarning' );