r95757 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95756‎ | r95757 | r95758 >
Date:11:44, 30 August 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Got rid of const MSG = ...
Modified paths:
  • /trunk/extensions/Translate/Translate.i18n.php (modified) (history)
  • /trunk/extensions/Translate/TranslateUtils.php (modified) (history)
  • /trunk/extensions/Translate/groups/ComplexMessages.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialMagic.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialTranslationChanges.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/groups/ComplexMessages.php
@@ -14,7 +14,6 @@
1515 * @todo Needs documentation.
1616 */
1717 abstract class ComplexMessages {
18 - const MSG = 'translate-magic-cm-';
1918
2019 const LANG_MASTER = 0;
2120 const LANG_CHAIN = 1;
@@ -303,8 +302,8 @@
304303
305304 public function getButtons() {
306305 return
307 - Xml::inputLabel( wfMsg( self::MSG . 'comment' ), 'comment', 'sp-translate-magic-comment' ) .
308 - Xml::submitButton( wfMsg( self::MSG . 'save' ), array( 'name' => 'savetodb' ) );
 306+ Xml::inputLabel( wfMsg( 'translate-magic-cm-comment' ), 'comment', 'sp-translate-magic-comment' ) .
 307+ Xml::submitButton( wfMsg( 'translate-magic-cm-save' ), array( 'name' => 'savetodb' ) );
309308 }
310309
311310 public function formatElement( $element ) {
@@ -364,11 +363,11 @@
365364
366365 $data = "# DO NOT EDIT THIS PAGE DIRECTLY! Use [[Special:AdvancedTranslate]].\n<pre>\n" . $this->formatForSave( $request ) . "\n</pre>";
367366
368 - $comment = $request->getText( 'comment', wfMsgForContent( self::MSG . 'updatedusing' ) );
 367+ $comment = $request->getText( 'comment', wfMsgForContent( 'translate-magic-cm-updatedusing' ) );
369368 $status = $article->doEdit( $data, $comment, 0 );
370369
371370 if ( $status === false || ( is_object( $status ) && !$status->isOK() ) ) {
372 - throw new MWException( wfMsgHtml( self::MSG . 'savefailed' ) );
 371+ throw new MWException( wfMsg( 'translate-magic-cm-savefailed' ) );
373372 }
374373
375374 /* Reset outdated array */
Index: trunk/extensions/Translate/Translate.i18n.php
@@ -129,6 +129,7 @@
130130 'translationchanges' => 'Translation changes',
131131 'translationchanges-export' => 'export',
132132 'translationchanges-change' => '$1: $2 by $3',
 133+ 'translationchanges-submit' => 'Fetch',
133134
134135 'translate-checks-parameters' => 'Following {{PLURAL:$2|parameter is|parameters are}} not used:
135136 <strong><nowiki>$1</nowiki></strong>',
Index: trunk/extensions/Translate/specials/SpecialMagic.php
@@ -15,11 +15,6 @@
1616 * @ingroup SpecialPage TranslateSpecialPage
1717 */
1818 class SpecialMagic extends SpecialPage {
19 - /**
20 - * Message prefix for translations
21 - * @todo Remove.
22 - */
23 - const MSG = 'translate-magic-';
2419
2520 const MODULE_MAGIC = 'words';
2621 const MODULE_SPECIAL = 'special';
@@ -49,7 +44,7 @@
5045 * @see SpecialPage::getDescription
5146 */
5247 function getDescription() {
53 - return wfMsg( self::MSG . 'pagename' );
 48+ return wfMsg( 'translate-magic-pagename' );
5449 }
5550
5651 /**
@@ -74,7 +69,7 @@
7570 '</td><td>' .
7671 $this->moduleSelector( $this->options['module'] ) .
7772 '</td></tr><tr><td colspan="2">' .
78 - Xml::submitButton( wfMsg( self::MSG . 'submit' ) ) . ' ' .
 73+ Xml::submitButton( wfMsg( 'translate-magic-submit' ) ) . ' ' .
7974 Xml::submitButton( wfMsg( 'translate-magic-cm-export' ), array( 'name' => 'export' ) ) .
8075 '</td></tr></table>' .
8176 Html::hidden( 'title', $this->getTitle()->getPrefixedText() )
@@ -91,7 +86,7 @@
9287 protected function moduleSelector( $selectedId ) {
9388 $selector = new HTMLSelector( 'module', 'module', $selectedId );
9489 foreach ( $this->aModules as $code ) {
95 - $selector->addOption( wfMsg( self::MSG . $code ), $code );
 90+ $selector->addOption( wfMsg( 'translate-magic-' . $code ), $code );
9691 }
9792 return $selector->getHTML();
9893 }
@@ -194,7 +189,7 @@
195190 return;
196191 }
197192
198 - $wgOut->addWikiMsg( self::MSG . 'help' );
 193+ $wgOut->addWikiMsg( 'translate-magic-help' );
199194 $errors = array();
200195 $o->validate( $errors );
201196 if ( $errors ) $this->outputErrors( $errors );
Index: trunk/extensions/Translate/specials/SpecialTranslationChanges.php
@@ -16,7 +16,6 @@
1717 * @ingroup SpecialPage TranslateSpecialPage
1818 */
1919 class SpecialTranslationChanges extends SpecialPage {
20 - const MSG = 'translationchanges-';
2120
2221 function __construct() {
2322 parent::__construct( 'TranslationChanges' );
@@ -48,7 +47,7 @@
4948 global $wgScript;
5049
5150 $limit = self::timeLimitSelector( $this->hours );
52 - $button = Xml::submitButton( wfMsg( TranslateUtils::MSG . 'submit' ) );
 51+ $button = Xml::submitButton( wfMsg( 'translationchanges-submit' ) );
5352
5453 $form = Xml::tags( 'form',
5554 array(
@@ -147,7 +146,7 @@
148147
149148 $output .= Xml::element( 'h3', null, $label );
150149
151 - $exportLabel = wfMsgHtml( self::MSG . 'export' );
 150+ $exportLabel = wfMsgHtml( 'translationchanges-export' );
152151
153152 foreach ( $languages as $language => $rows ) {
154153 $index++;
@@ -193,7 +192,7 @@
194193 foreach ( $rows as $row ) {
195194 $date = $wgLang->timeAndDate( $row->rc_timestamp, /* adj */ true, /* format */ true );
196195 $msg = wfMsgExt(
197 - self::MSG . 'change',
 196+ 'translationchanges-change',
198197 array( 'parsemag', 'escape' ),
199198 $date,
200199 wfEscapeWikiText( $row->rc_title ),
Index: trunk/extensions/Translate/TranslateUtils.php
@@ -12,8 +12,6 @@
1313 * Essentially random collection of helper functions, similar to GlobalFunctions.php.
1414 */
1515 class TranslateUtils {
16 - /// @todo Get rid of this constant.
17 - const MSG = 'translate-';
1816
1917 /**
2018 * Does quick normalisation of message name so that in can be looked from the

Comments

#Comment by Siebrand (talk | contribs)   11:47, 30 August 2011

+ 'translationchanges-submit' => 'Fetch',: seems not related to the primary changes.

#Comment by Nikerabbit (talk | contribs)   13:08, 30 August 2011

Just for the record: it is (I splitted it from using another message)

Status & tagging log