Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -784,7 +784,7 @@ |
785 | 785 | $this->mPagetitle = $nameWithTags; |
786 | 786 | |
787 | 787 | # change "<i>foo&bar</i>" to "foo&bar" |
788 | | - $this->setHTMLTitle( wfMsg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) ) ); |
| 788 | + $this->setHTMLTitle( $this->msg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) )->text() ); |
789 | 789 | } |
790 | 790 | |
791 | 791 | /** |
— | — | @@ -1927,8 +1927,8 @@ |
1928 | 1928 | if ( $this->getTitle() ) { |
1929 | 1929 | $this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n"; |
1930 | 1930 | } |
1931 | | - $this->setPageTitle( wfMsg( $title ) ); |
1932 | | - $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) ); |
| 1931 | + $this->setPageTitle( $this->msg( $title )->text() ); |
| 1932 | + $this->setHTMLTitle( $this->msg( 'errorpagetitle' )->text() ); |
1933 | 1933 | $this->setRobotPolicy( 'noindex,nofollow' ); |
1934 | 1934 | $this->setArticleRelated( false ); |
1935 | 1935 | $this->enableClientCache( false ); |
— | — | @@ -1953,8 +1953,8 @@ |
1954 | 1954 | public function showPermissionsErrorPage( $errors, $action = null ) { |
1955 | 1955 | $this->mDebugtext .= 'Original title: ' . |
1956 | 1956 | $this->getTitle()->getPrefixedText() . "\n"; |
1957 | | - $this->setPageTitle( wfMsg( 'permissionserrors' ) ); |
1958 | | - $this->setHTMLTitle( wfMsg( 'permissionserrors' ) ); |
| 1957 | + $this->setPageTitle( $this->msg( 'permissionserrors' )->text() ); |
| 1958 | + $this->setHTMLTitle( $this->msg( 'permissionserrors' )->text() ); |
1959 | 1959 | $this->setRobotPolicy( 'noindex,nofollow' ); |
1960 | 1960 | $this->setArticleRelated( false ); |
1961 | 1961 | $this->enableClientCache( false ); |
— | — | @@ -1970,8 +1970,8 @@ |
1971 | 1971 | * @param $version Mixed: the version of MediaWiki needed to use the page |
1972 | 1972 | */ |
1973 | 1973 | public function versionRequired( $version ) { |
1974 | | - $this->setPageTitle( wfMsg( 'versionrequired', $version ) ); |
1975 | | - $this->setHTMLTitle( wfMsg( 'versionrequired', $version ) ); |
| 1974 | + $this->setPageTitle( $this->msg( 'versionrequired', $version )->text() ); |
| 1975 | + $this->setHTMLTitle( $this->msg( 'versionrequired', $version )->text() ); |
1976 | 1976 | $this->setRobotPolicy( 'noindex,nofollow' ); |
1977 | 1977 | $this->setArticleRelated( false ); |
1978 | 1978 | $this->mBodytext = ''; |
— | — | @@ -1997,19 +1997,19 @@ |
1998 | 1998 | throw new PermissionsError( 'read' ); |
1999 | 1999 | } |
2000 | 2000 | |
2001 | | - $this->setPageTitle( wfMsg( 'loginreqtitle' ) ); |
2002 | | - $this->setHtmlTitle( wfMsg( 'errorpagetitle' ) ); |
| 2001 | + $this->setPageTitle( $this->msg( 'loginreqtitle' )->text() ); |
| 2002 | + $this->setHTMLTitle( $this->msg( 'errorpagetitle' )->text() ); |
2003 | 2003 | $this->setRobotPolicy( 'noindex,nofollow' ); |
2004 | 2004 | $this->setArticleRelated( false ); |
2005 | 2005 | |
2006 | 2006 | $loginTitle = SpecialPage::getTitleFor( 'Userlogin' ); |
2007 | 2007 | $loginLink = Linker::linkKnown( |
2008 | 2008 | $loginTitle, |
2009 | | - wfMsgHtml( 'loginreqlink' ), |
| 2009 | + $this->msg( 'loginreqlink' )->escaped(), |
2010 | 2010 | array(), |
2011 | 2011 | array( 'returnto' => $this->getTitle()->getPrefixedText() ) |
2012 | 2012 | ); |
2013 | | - $this->addHTML( wfMessage( 'loginreqpagetext' )->rawParams( $loginLink )->parse() . |
| 2013 | + $this->addHTML( $this->msg( 'loginreqpagetext' )->rawParams( $loginLink )->parse() . |
2014 | 2014 | "\n<!--" . $this->getTitle()->getPrefixedUrl() . '-->' ); |
2015 | 2015 | |
2016 | 2016 | # Don't return to the main page if the user can't read it |
— | — | @@ -2029,14 +2029,14 @@ |
2030 | 2030 | */ |
2031 | 2031 | public function formatPermissionsErrorMessage( $errors, $action = null ) { |
2032 | 2032 | if ( $action == null ) { |
2033 | | - $text = wfMsgNoTrans( 'permissionserrorstext', count( $errors ) ) . "\n\n"; |
| 2033 | + $text = $this->msg( 'permissionserrorstext', count( $errors ) )->plain() . "\n\n"; |
2034 | 2034 | } else { |
2035 | | - $action_desc = wfMsgNoTrans( "action-$action" ); |
2036 | | - $text = wfMsgNoTrans( |
| 2035 | + $action_desc = $this->msg( "action-$action" )->plain(); |
| 2036 | + $text = $this->msg( |
2037 | 2037 | 'permissionserrorstext-withaction', |
2038 | 2038 | count( $errors ), |
2039 | 2039 | $action_desc |
2040 | | - ) . "\n\n"; |
| 2040 | + )->plain() . "\n\n"; |
2041 | 2041 | } |
2042 | 2042 | |
2043 | 2043 | if ( count( $errors ) > 1 ) { |
— | — | @@ -2044,13 +2044,13 @@ |
2045 | 2045 | |
2046 | 2046 | foreach( $errors as $error ) { |
2047 | 2047 | $text .= '<li>'; |
2048 | | - $text .= call_user_func_array( 'wfMsgNoTrans', $error ); |
| 2048 | + $text .= call_user_func_array( array( $this, 'msg' ), $error )->plain(); |
2049 | 2049 | $text .= "</li>\n"; |
2050 | 2050 | } |
2051 | 2051 | $text .= '</ul>'; |
2052 | 2052 | } else { |
2053 | 2053 | $text .= "<div class=\"permissions-errors\">\n" . |
2054 | | - call_user_func_array( 'wfMsgNoTrans', reset( $errors ) ) . |
| 2054 | + call_user_func_array( array( $this, 'msg' ), reset( $errors ) )->plain() . |
2055 | 2055 | "\n</div>"; |
2056 | 2056 | } |
2057 | 2057 | |
— | — | @@ -2090,12 +2090,12 @@ |
2091 | 2091 | if ( !empty( $reasons ) ) { |
2092 | 2092 | // Permissions error |
2093 | 2093 | if( $source ) { |
2094 | | - $this->setPageTitle( wfMsg( 'viewsource' ) ); |
| 2094 | + $this->setPageTitle( $this->msg( 'viewsource' )->text() ); |
2095 | 2095 | $this->setSubtitle( |
2096 | | - wfMsg( 'viewsourcefor', Linker::linkKnown( $this->getTitle() ) ) |
| 2096 | + $this->msg( 'viewsourcefor', Linker::linkKnown( $this->getTitle() ) )->text() |
2097 | 2097 | ); |
2098 | 2098 | } else { |
2099 | | - $this->setPageTitle( wfMsg( 'badaccess' ) ); |
| 2099 | + $this->setPageTitle( $this->msg( 'badaccess' )->text() ); |
2100 | 2100 | } |
2101 | 2101 | $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) ); |
2102 | 2102 | } else { |
— | — | @@ -2160,12 +2160,12 @@ |
2161 | 2161 | ? 'lag-warn-normal' |
2162 | 2162 | : 'lag-warn-high'; |
2163 | 2163 | $wrap = Html::rawElement( 'div', array( 'class' => "mw-{$message}" ), "\n$1\n" ); |
2164 | | - $this->wrapWikiMsg( "$wrap\n", array( $message, $this->getContext()->getLang()->formatNum( $lag ) ) ); |
| 2164 | + $this->wrapWikiMsg( "$wrap\n", array( $message, $this->getLang()->formatNum( $lag ) ) ); |
2165 | 2165 | } |
2166 | 2166 | } |
2167 | 2167 | |
2168 | 2168 | public function showFatalError( $message ) { |
2169 | | - $this->setPageTitle( wfMsg( 'internalerror' ) ); |
| 2169 | + $this->setPageTitle( $this->msg( 'internalerror' )->text() ); |
2170 | 2170 | $this->setRobotPolicy( 'noindex,nofollow' ); |
2171 | 2171 | $this->setArticleRelated( false ); |
2172 | 2172 | $this->enableClientCache( false ); |
— | — | @@ -2174,23 +2174,23 @@ |
2175 | 2175 | } |
2176 | 2176 | |
2177 | 2177 | public function showUnexpectedValueError( $name, $val ) { |
2178 | | - $this->showFatalError( wfMsg( 'unexpected', $name, $val ) ); |
| 2178 | + $this->showFatalError( $this->msg( 'unexpected', $name, $val )->text() ); |
2179 | 2179 | } |
2180 | 2180 | |
2181 | 2181 | public function showFileCopyError( $old, $new ) { |
2182 | | - $this->showFatalError( wfMsg( 'filecopyerror', $old, $new ) ); |
| 2182 | + $this->showFatalError( $this->msg( 'filecopyerror', $old, $new )->text() ); |
2183 | 2183 | } |
2184 | 2184 | |
2185 | 2185 | public function showFileRenameError( $old, $new ) { |
2186 | | - $this->showFatalError( wfMsg( 'filerenameerror', $old, $new ) ); |
| 2186 | + $this->showFatalError( $this->msg( 'filerenameerror', $old, $new )->text() ); |
2187 | 2187 | } |
2188 | 2188 | |
2189 | 2189 | public function showFileDeleteError( $name ) { |
2190 | | - $this->showFatalError( wfMsg( 'filedeleteerror', $name ) ); |
| 2190 | + $this->showFatalError( $this->msg( 'filedeleteerror', $name )->text() ); |
2191 | 2191 | } |
2192 | 2192 | |
2193 | 2193 | public function showFileNotFoundError( $name ) { |
2194 | | - $this->showFatalError( wfMsg( 'filenotfound', $name ) ); |
| 2194 | + $this->showFatalError( $this->msg( 'filenotfound', $name )->text() ); |
2195 | 2195 | } |
2196 | 2196 | |
2197 | 2197 | /** |
— | — | @@ -2202,10 +2202,8 @@ |
2203 | 2203 | */ |
2204 | 2204 | public function addReturnTo( $title, $query = array(), $text = null ) { |
2205 | 2205 | $this->addLink( array( 'rel' => 'next', 'href' => $title->getFullURL() ) ); |
2206 | | - $link = wfMsgHtml( |
2207 | | - 'returnto', |
2208 | | - Linker::link( $title, $text, array(), $query ) |
2209 | | - ); |
| 2206 | + $link = $this->msg( 'returnto' )->rawParams( |
| 2207 | + Linker::link( $title, $text, array(), $query ) )->escaped(); |
2210 | 2208 | $this->addHTML( "<p id=\"mw-returnto\">{$link}</p>\n" ); |
2211 | 2209 | } |
2212 | 2210 | |
— | — | @@ -2259,7 +2257,7 @@ |
2260 | 2258 | $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) ); |
2261 | 2259 | |
2262 | 2260 | if ( $this->getHTMLTitle() == '' ) { |
2263 | | - $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) ); |
| 2261 | + $this->setHTMLTitle( $this->msg( 'pagetitle', $this->getPageTitle() )->text() ); |
2264 | 2262 | } |
2265 | 2263 | |
2266 | 2264 | $openHead = Html::openElement( 'head' ); |
— | — | @@ -2291,7 +2289,7 @@ |
2292 | 2290 | # Classes for LTR/RTL directionality support |
2293 | 2291 | $bodyAttrs['class'] = "mediawiki $userdir sitedir-$sitedir"; |
2294 | 2292 | |
2295 | | - if ( $this->getContext()->getLang()->capitalizeAllNouns() ) { |
| 2293 | + if ( $this->getLang()->capitalizeAllNouns() ) { |
2296 | 2294 | # A <body> class is probably not the best way to do this . . . |
2297 | 2295 | $bodyAttrs['class'] .= ' capitalize-all-nouns'; |
2298 | 2296 | } |
— | — | @@ -2425,7 +2423,7 @@ |
2426 | 2424 | // correct timestamp and emptiness data |
2427 | 2425 | $query = ResourceLoader::makeLoaderQuery( |
2428 | 2426 | array(), // modules; not determined yet |
2429 | | - $this->getContext()->getLang()->getCode(), |
| 2427 | + $this->getLang()->getCode(), |
2430 | 2428 | $this->getSkin()->getSkinName(), |
2431 | 2429 | $user, |
2432 | 2430 | null, // version; not determined yet |
— | — | @@ -2481,7 +2479,7 @@ |
2482 | 2480 | |
2483 | 2481 | $url = ResourceLoader::makeLoaderURL( |
2484 | 2482 | array_keys( $modules ), |
2485 | | - $this->getContext()->getLang()->getCode(), |
| 2483 | + $this->getLang()->getCode(), |
2486 | 2484 | $this->getSkin()->getSkinName(), |
2487 | 2485 | $user, |
2488 | 2486 | $version, |
— | — | @@ -2800,7 +2798,7 @@ |
2801 | 2799 | if ( $this->isArticleRelated() && $this->getTitle() && $this->getTitle()->quickUserCan( 'edit' ) |
2802 | 2800 | && ( $this->getTitle()->exists() || $this->getTitle()->quickUserCan( 'create' ) ) ) { |
2803 | 2801 | // Original UniversalEditButton |
2804 | | - $msg = wfMsg( 'edit' ); |
| 2802 | + $msg = $this->msg( 'edit' )->text(); |
2805 | 2803 | $tags[] = Html::element( 'link', array( |
2806 | 2804 | 'rel' => 'alternate', |
2807 | 2805 | 'type' => 'application/x-wiki', |
— | — | @@ -2833,7 +2831,7 @@ |
2834 | 2832 | 'rel' => 'search', |
2835 | 2833 | 'type' => 'application/opensearchdescription+xml', |
2836 | 2834 | 'href' => wfScript( 'opensearch_desc' ), |
2837 | | - 'title' => wfMsgForContent( 'opensearch-desc' ), |
| 2835 | + 'title' => $this->msg( 'opensearch-desc' )->inContentLanguage()->text(), |
2838 | 2836 | ) ); |
2839 | 2837 | |
2840 | 2838 | if ( $wgEnableAPI ) { |
— | — | @@ -2908,7 +2906,7 @@ |
2909 | 2907 | $format, |
2910 | 2908 | $link, |
2911 | 2909 | # Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep) |
2912 | | - wfMsg( "page-{$format}-feed", $this->getTitle()->getPrefixedText() ) |
| 2910 | + $this->msg( "page-{$format}-feed", $this->getTitle()->getPrefixedText() )->text() |
2913 | 2911 | ); |
2914 | 2912 | } |
2915 | 2913 | |
— | — | @@ -2928,7 +2926,7 @@ |
2929 | 2927 | $tags[] = $this->feedLink( |
2930 | 2928 | $type, |
2931 | 2929 | $feedUrl, |
2932 | | - wfMsg( "site-{$type}-feed", $wgSitename ) |
| 2930 | + $this->msg( "site-{$type}-feed", $wgSitename )->text() |
2933 | 2931 | ); |
2934 | 2932 | } |
2935 | 2933 | } elseif ( $this->getTitle()->getPrefixedText() != $rctitle->getPrefixedText() ) { |
— | — | @@ -2936,7 +2934,7 @@ |
2937 | 2935 | $tags[] = $this->feedLink( |
2938 | 2936 | $format, |
2939 | 2937 | $rctitle->getLocalURL( "feed={$format}" ), |
2940 | | - wfMsg( "site-{$format}-feed", $wgSitename ) # For grep: 'site-rss-feed', 'site-atom-feed'. |
| 2938 | + $this->msg( "site-{$format}-feed", $wgSitename )->text() # For grep: 'site-rss-feed', 'site-atom-feed'. |
2941 | 2939 | ); |
2942 | 2940 | } |
2943 | 2941 | } |
— | — | @@ -3199,16 +3197,11 @@ |
3200 | 3198 | * Like addWikiMsg() except the parameters are taken as an array |
3201 | 3199 | * instead of a variable argument list. |
3202 | 3200 | * |
3203 | | - * $options is passed through to wfMsgExt(), see that function for details. |
3204 | | - * |
3205 | 3201 | * @param $name string |
3206 | 3202 | * @param $args array |
3207 | | - * @param $options array |
3208 | 3203 | */ |
3209 | | - public function addWikiMsgArray( $name, $args, $options = array() ) { |
3210 | | - $options[] = 'parse'; |
3211 | | - $text = wfMsgExt( $name, $options, $args ); |
3212 | | - $this->addHTML( $text ); |
| 3204 | + public function addWikiMsgArray( $name, $args ) { |
| 3205 | + $this->addWikiText( $this->msg( $name, $args )->plain() ); |
3213 | 3206 | } |
3214 | 3207 | |
3215 | 3208 | /** |