r73939 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73938‎ | r73939 | r73940 >
Date:08:40, 29 September 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Get rid of MSG constant
Modified paths:
  • /trunk/extensions/Translate/TranslatePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslatePage.php
@@ -16,8 +16,6 @@
1717 * @ingroup SpecialPage TranslateSpecialPage
1818 */
1919 class SpecialTranslate extends SpecialPage {
20 - const MSG = 'translate-page-';
21 -
2220 protected $task = null;
2321 protected $group = null;
2422
@@ -60,17 +58,17 @@
6159 $codes = Language::getLanguageNames( false );
6260
6361 if ( !$this->options['language'] || !isset( $codes[$this->options['language']] ) ) {
64 - $errors['language'] = wfMsgExt( self::MSG . 'no-such-language', array( 'parse' ) );
 62+ $errors['language'] = wfMsgExt( 'translate-page-no-such-language', array( 'parse' ) );
6563 $this->options['language'] = $this->defaults['language'];
6664 }
6765
6866 if ( !$this->task instanceof TranslateTask ) {
69 - $errors['task'] = wfMsgExt( self::MSG . 'no-such-task', array( 'parse' ) );
 67+ $errors['task'] = wfMsgExt( 'translate-page-no-such-task', array( 'parse' ) );
7068 $this->options['task'] = $this->defaults['task'];
7169 }
7270
7371 if ( !$this->group instanceof MessageGroup ) {
74 - $errors['group'] = wfMsgExt( self::MSG . 'no-such-group', array( 'parse' ) );
 72+ $errors['group'] = wfMsgExt( 'translate-page-no-such-group', array( 'parse' ) );
7573 $this->options['group'] = $this->defaults['group'];
7674 }
7775
@@ -91,7 +89,7 @@
9290 foreach ( $checks as $check ) {
9391 $reason = @$wgTranslateBlacklist[$check][$this->options['language']];
9492 if ( $reason !== null ) {
95 - $wgOut->addWikiMsg( self::MSG . 'disabled', $reason );
 93+ $wgOut->addWikiMsg( 'translate-page-disabled', $reason );
9694 return;
9795 }
9896 }
@@ -120,7 +118,7 @@
121119 } else {
122120 $description = $this->getGroupDescription( $this->group );
123121 if ( $description ) {
124 - $description = Xml::fieldset( wfMsg( self::MSG . 'description-legend' ), $description );
 122+ $description = Xml::fieldset( wfMsg( 'translate-page-description-legend' ), $description );
125123 }
126124
127125 $links = $this->doStupidLinks();
@@ -199,13 +197,13 @@
200198 $group = $this->groupSelector();
201199 $language = $this->languageSelector();
202200 $limit = $this->limitSelector();
203 - $button = Xml::submitButton( wfMsg( TranslateUtils::MSG . 'submit' ) );
 201+ $button = Xml::submitButton( wfMsg( 'translate-submit' ) );
204202
205203 $options = array();
206204
207205 foreach ( array( 'task', 'group', 'language', 'limit' ) as $g ) {
208206 $options[] = self::optionRow(
209 - Xml::tags( 'label', array( 'for' => $g ), wfMsgExt( self::MSG . $g, 'escapenoentities' ) ),
 207+ Xml::tags( 'label', array( 'for' => $g ), wfMsgExt( 'translate-page-' . $g, 'escapenoentities' ) ),
210208 $$g,
211209 array_key_exists( $g, $errors ) ? $errors[$g] : null
212210 );
@@ -213,7 +211,7 @@
214212
215213 $form =
216214 Xml::openElement( 'fieldset', array( 'class' => 'mw-sp-translate-settings' ) ) .
217 - Xml::element( 'legend', null, wfMsg( self::MSG . 'settings-legend' ) ) .
 215+ Xml::element( 'legend', null, wfMsg( 'translate-page-settings-legend' ) ) .
218216 Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
219217 Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
220218 Xml::openElement( 'table' ) .
@@ -278,7 +276,7 @@
279277 $selector = new HTMLSelector( 'limit', 'limit', $this->options['limit'] );
280278
281279 foreach ( $items as $count ) {
282 - $selector->addOption( wfMsgExt( self::MSG . 'limit-option', 'parsemag', $wgLang->formatNum( $count ) ), $count );
 280+ $selector->addOption( wfMsgExt( 'translate-page-limit-option', 'parsemag', $wgLang->formatNum( $count ) ), $count );
283281 }
284282
285283 return $selector->getHTML();
@@ -306,21 +304,21 @@
307305 $allInThisPage = $start === 1 && $total <= $this->options['limit'];
308306
309307 if ( $this->paging['count'] === 0 ) {
310 - $navigation = wfMsgExt( self::MSG . 'showing-none', array( 'parseinline' ) );
 308+ $navigation = wfMsgExt( 'translate-page-showing-none', array( 'parseinline' ) );
311309 } elseif ( $allInThisPage ) {
312310 $navigation = wfMsgExt(
313 - self::MSG . 'showing-all',
 311+ 'translate-page-showing-all',
314312 array( 'parseinline' ),
315313 $total
316314 );
317315 } else {
318 - $previous = wfMsg( TranslateUtils::MSG . 'prev' );
 316+ $previous = wfMsg( 'translate-prev' );
319317 if ( $this->options['offset'] > 0 ) {
320318 $offset = max( 0, $this->options['offset'] - $this->options['limit'] );
321319 $previous = $this->makeOffsetLink( $previous, $offset );
322320 }
323321
324 - $nextious = wfMsg( TranslateUtils::MSG . 'next' );
 322+ $nextious = wfMsg( 'translate-next' );
325323
326324 if ( $this->paging['total'] != $this->paging['start'] + $this->paging['count'] ) {
327325 $offset = $this->options['offset'] + $this->options['limit'];
@@ -332,14 +330,14 @@
333331 $total = $this->paging['total'];
334332
335333 $showing = wfMsgExt(
336 - self::MSG . 'showing',
 334+ 'translate-page-showing',
337335 array( 'parseinline' ),
338336 $start,
339337 $stop,
340338 $total );
341339
342340 $navigation = wfMsgExt(
343 - self::MSG . 'paging-links',
 341+ 'translate-page-paging-links',
344342 array( 'escape', 'replaceafter' ),
345343 $previous,
346344 $nextious
@@ -350,7 +348,7 @@
351349
352350 return
353351 Xml::openElement( 'fieldset' ) .
354 - Xml::element( 'legend', null, wfMsg( self::MSG . 'navigation-legend' ) ) .
 352+ Xml::element( 'legend', null, wfMsg( 'translate-page-navigation-legend' ) ) .
355353 $navigation .
356354 Xml::closeElement( 'fieldset' );
357355 }

Status & tagging log