Index: trunk/phase3/includes/Skin.php |
— | — | @@ -383,14 +383,15 @@ |
384 | 384 | $pop = "</li>"; |
385 | 385 | |
386 | 386 | $s = ''; |
387 | | - $colon = wfMsgExt( 'colon-separator', 'escapenoentities' ); |
| 387 | + $colon = $this->msg( 'colon-separator' )->escaped(); |
388 | 388 | |
389 | 389 | if ( !empty( $allCats['normal'] ) ) { |
390 | 390 | $t = $embed . implode( "{$pop}{$embed}" , $allCats['normal'] ) . $pop; |
391 | 391 | |
392 | | - $msg = wfMsgExt( 'pagecategories', array( 'parsemag', 'escapenoentities' ), count( $allCats['normal'] ) ); |
| 392 | + $msg = $this->msg( 'pagecategories', count( $allCats['normal'] ) )->escaped(); |
| 393 | + $linkPage = wfMessage( 'pagecategorieslink' )->inContentLanguage()->text(); |
393 | 394 | $s .= '<div id="mw-normal-catlinks" class="mw-normal-catlinks">' . |
394 | | - Linker::link( Title::newFromText( wfMsgForContent( 'pagecategorieslink' ) ), $msg ) |
| 395 | + Linker::link( Title::newFromText( $linkPage ), $msg ) |
395 | 396 | . $colon . '<ul>' . $t . '</ul>' . '</div>'; |
396 | 397 | } |
397 | 398 | |
— | — | @@ -405,7 +406,7 @@ |
406 | 407 | } |
407 | 408 | |
408 | 409 | $s .= "<div id=\"mw-hidden-catlinks\" class=\"mw-hidden-catlinks$class\">" . |
409 | | - wfMsgExt( 'hidden-categories', array( 'parsemag', 'escapenoentities' ), count( $allCats['hidden'] ) ) . |
| 410 | + $this->msg( 'hidden-categories', count( $allCats['hidden'] ) )->escaped() . |
410 | 411 | $colon . '<ul>' . $embed . implode( "{$pop}{$embed}" , $allCats['hidden'] ) . $pop . '</ul>' . |
411 | 412 | '</div>'; |
412 | 413 | } |
— | — | @@ -605,7 +606,7 @@ |
606 | 607 | // oldid not available for non existing pages |
607 | 608 | $url = htmlspecialchars( $this->getTitle()->getCanonicalURL() ); |
608 | 609 | } |
609 | | - return wfMsg( 'retrievedfrom', '<a href="' . $url . '">' . $url . '</a>' ); |
| 610 | + return $this->msg( 'retrievedfrom', '<a href="' . $url . '">' . $url . '</a>' )->text(); |
610 | 611 | } |
611 | 612 | |
612 | 613 | function getUndeleteLink() { |
— | — | @@ -623,13 +624,11 @@ |
624 | 625 | $msg = 'viewdeleted'; |
625 | 626 | } |
626 | 627 | |
627 | | - return wfMsg( |
628 | | - $msg, |
| 628 | + return $this->msg( $msg )->rawParams( |
629 | 629 | Linker::linkKnown( |
630 | 630 | SpecialPage::getTitleFor( 'Undelete', $this->getTitle()->getPrefixedDBkey() ), |
631 | | - wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $this->getLang()->formatNum( $n ) ) |
632 | | - ) |
633 | | - ); |
| 631 | + $this->msg( 'restorelink' )->numParams( $n )->escaped() ) |
| 632 | + )->text(); |
634 | 633 | } |
635 | 634 | } |
636 | 635 | |
— | — | @@ -667,7 +666,7 @@ |
668 | 667 | $c++; |
669 | 668 | |
670 | 669 | if ( $c > 1 ) { |
671 | | - $subpages .= wfMsgExt( 'pipe-separator', 'escapenoentities' ); |
| 670 | + $subpages .= $this->msg( 'pipe-separator' )->escaped(); |
672 | 671 | } else { |
673 | 672 | $subpages .= '< '; |
674 | 673 | } |
— | — | @@ -707,7 +706,7 @@ |
708 | 707 | global $wgRightsPage, $wgRightsUrl, $wgRightsText, $wgContLang; |
709 | 708 | |
710 | 709 | if ( $type == 'detect' ) { |
711 | | - if ( !$this->isRevisionCurrent() && wfMsgForContent( 'history_copyright' ) !== '-' ) { |
| 710 | + if ( !$this->isRevisionCurrent() && !$this->msg( 'history_copyright' )->inContentLanguage()->isDisabled() ) { |
712 | 711 | $type = 'history'; |
713 | 712 | } else { |
714 | 713 | $type = 'normal'; |
— | — | @@ -737,14 +736,15 @@ |
738 | 737 | |
739 | 738 | wfRunHooks( 'SkinCopyrightFooter', array( $this->getTitle(), $type, &$msg, &$link, &$forContent ) ); |
740 | 739 | |
| 740 | + $msgObj = $this->msg( $msg )->rawParams( $link ); |
741 | 741 | if ( $forContent ) { |
742 | | - $msg = wfMsgForContent( $msg, $link ); |
| 742 | + $msg = $msgObj->inContentLanguage()->text(); |
743 | 743 | if ( $this->getLang()->getCode() !== $wgContLang->getCode() ) { |
744 | 744 | $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $msg ); |
745 | 745 | } |
746 | 746 | return $msg; |
747 | 747 | } else { |
748 | | - return wfMsg( $msg, $link ); |
| 748 | + return $msgObj->text(); |
749 | 749 | } |
750 | 750 | } |
751 | 751 | |
— | — | @@ -801,15 +801,15 @@ |
802 | 802 | } |
803 | 803 | |
804 | 804 | if ( $timestamp ) { |
805 | | - $d = $this->getLang()->date( $timestamp, true ); |
806 | | - $t = $this->getLang()->time( $timestamp, true ); |
807 | | - $s = ' ' . wfMsg( 'lastmodifiedat', $d, $t ); |
| 805 | + $d = $this->getLang()->userDate( $timestamp, $this->getUser() ); |
| 806 | + $t = $this->getLang()->userTime( $timestamp, $this->getUser() ); |
| 807 | + $s = ' ' . $this->msg( 'lastmodifiedat', $d, $t )->text(); |
808 | 808 | } else { |
809 | 809 | $s = ''; |
810 | 810 | } |
811 | 811 | |
812 | 812 | if ( wfGetLB()->getLaggedSlaveMode() ) { |
813 | | - $s .= ' <strong>' . wfMsg( 'laggedslavemode' ) . '</strong>'; |
| 813 | + $s .= ' <strong>' . $this->msg( 'laggedslavemode' )->text() . '</strong>'; |
814 | 814 | } |
815 | 815 | |
816 | 816 | return $s; |
— | — | @@ -822,7 +822,7 @@ |
823 | 823 | $a = ''; |
824 | 824 | } |
825 | 825 | |
826 | | - $mp = wfMsgHtml( 'mainpage' ); |
| 826 | + $mp = $this->msg( 'mainpage' )->escaped(); |
827 | 827 | $mptitle = Title::newMainPage(); |
828 | 828 | $url = ( is_object( $mptitle ) ? $mptitle->escapeLocalURL() : '' ); |
829 | 829 | |
— | — | @@ -863,7 +863,7 @@ |
864 | 864 | function mainPageLink() { |
865 | 865 | $s = Linker::linkKnown( |
866 | 866 | Title::newMainPage(), |
867 | | - wfMsgHtml( 'mainpage' ) |
| 867 | + $this->msg( 'mainpage' )->escaped() |
868 | 868 | ); |
869 | 869 | |
870 | 870 | return $s; |
— | — | @@ -871,18 +871,18 @@ |
872 | 872 | |
873 | 873 | public function footerLink( $desc, $page ) { |
874 | 874 | // if the link description has been set to "-" in the default language, |
875 | | - if ( wfMsgForContent( $desc ) == '-' ) { |
| 875 | + if ( $this->msg( $desc )->inContentLanguage()->isDisabled() ) { |
876 | 876 | // then it is disabled, for all languages. |
877 | 877 | return ''; |
878 | 878 | } else { |
879 | 879 | // Otherwise, we display the link for the user, described in their |
880 | 880 | // language (which may or may not be the same as the default language), |
881 | 881 | // but we make the link target be the one site-wide page. |
882 | | - $title = Title::newFromText( wfMsgForContent( $page ) ); |
| 882 | + $title = Title::newFromText( $this->msg( $page )->inContentLanguage()->text() ); |
883 | 883 | |
884 | 884 | return Linker::linkKnown( |
885 | 885 | $title, |
886 | | - wfMsgExt( $desc, array( 'parsemag', 'escapenoentities' ) ) |
| 886 | + $this->msg( $desc )->escaped() |
887 | 887 | ); |
888 | 888 | } |
889 | 889 | } |
— | — | @@ -1122,7 +1122,7 @@ |
1123 | 1123 | $line = array_map( 'trim', explode( '|', $line, 2 ) ); |
1124 | 1124 | $extraAttribs = array(); |
1125 | 1125 | |
1126 | | - $msgLink = wfMessage( $line[0] )->inContentLanguage(); |
| 1126 | + $msgLink = $this->msg( $line[0] )->inContentLanguage(); |
1127 | 1127 | if ( $msgLink->exists() ) { |
1128 | 1128 | $link = $msgLink->text(); |
1129 | 1129 | if ( $link == '-' ) { |
— | — | @@ -1132,7 +1132,7 @@ |
1133 | 1133 | $link = $line[0]; |
1134 | 1134 | } |
1135 | 1135 | |
1136 | | - $msgText = wfMessage( $line[1] ); |
| 1136 | + $msgText = $this->msg( $line[1] ); |
1137 | 1137 | if ( $msgText->exists() ) { |
1138 | 1138 | $text = $msgText->text(); |
1139 | 1139 | } else { |
— | — | @@ -1206,29 +1206,29 @@ |
1207 | 1207 | if ( !$userTalkTitle->equals( $out->getTitle() ) ) { |
1208 | 1208 | $newMessagesLink = Linker::linkKnown( |
1209 | 1209 | $userTalkTitle, |
1210 | | - wfMsgHtml( 'newmessageslink' ), |
| 1210 | + $this->msg( 'newmessageslink' )->escaped(), |
1211 | 1211 | array(), |
1212 | 1212 | array( 'redirect' => 'no' ) |
1213 | 1213 | ); |
1214 | 1214 | |
1215 | 1215 | $newMessagesDiffLink = Linker::linkKnown( |
1216 | 1216 | $userTalkTitle, |
1217 | | - wfMsgHtml( 'newmessagesdifflink' ), |
| 1217 | + $this->msg( 'newmessagesdifflink' )->escaped(), |
1218 | 1218 | array(), |
1219 | 1219 | array( 'diff' => 'cur' ) |
1220 | 1220 | ); |
1221 | 1221 | |
1222 | | - $ntl = wfMsg( |
| 1222 | + $ntl = $this->msg( |
1223 | 1223 | 'youhavenewmessages', |
1224 | 1224 | $newMessagesLink, |
1225 | 1225 | $newMessagesDiffLink |
1226 | | - ); |
| 1226 | + )->text(); |
1227 | 1227 | # Disable Squid cache |
1228 | 1228 | $out->setSquidMaxage( 0 ); |
1229 | 1229 | } |
1230 | 1230 | } elseif ( count( $newtalks ) ) { |
1231 | 1231 | // _>" " for BC <= 1.16 |
1232 | | - $sep = str_replace( '_', ' ', wfMsgHtml( 'newtalkseparator' ) ); |
| 1232 | + $sep = str_replace( '_', ' ', $this->msg( 'newtalkseparator' )->escaped() ); |
1233 | 1233 | $msgs = array(); |
1234 | 1234 | |
1235 | 1235 | foreach ( $newtalks as $newtalk ) { |
— | — | @@ -1238,7 +1238,7 @@ |
1239 | 1239 | ); |
1240 | 1240 | } |
1241 | 1241 | $parts = implode( $sep, $msgs ); |
1242 | | - $ntl = wfMsgHtml( 'youhavenewmessagesmulti', $parts ); |
| 1242 | + $ntl = $this->msg( 'youhavenewmessagesmulti' )->rawParams( $parts )->escaped(); |
1243 | 1243 | $out->setSquidMaxage( 0 ); |
1244 | 1244 | } |
1245 | 1245 | |
— | — | @@ -1267,7 +1267,7 @@ |
1268 | 1268 | return false; |
1269 | 1269 | } |
1270 | 1270 | } else { |
1271 | | - $msg = wfMessage( $name )->inContentLanguage(); |
| 1271 | + $msg = $this->msg( $name )->inContentLanguage(); |
1272 | 1272 | if( $msg->isDisabled() ) { |
1273 | 1273 | wfProfileOut( __METHOD__ ); |
1274 | 1274 | return false; |