r50663 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50662‎ | r50663 | r50664 >
Date:16:02, 16 May 2009
Author:purodha
Status:deferred
Tags:
Comment:
Cosmetic message changes and message corrections.
Modified paths:
  • /trunk/extensions/Plotters/Plotters.i18n.php (modified) (history)
  • /trunk/extensions/Plotters/PlottersClass.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Plotters/Plotters.i18n.php
@@ -12,28 +12,40 @@
1313
1414 /** English
1515 * @author Ryan Lane, rlane32+mwext@gmail.com
 16+ * @author Purodha
1617 */
1718 $messages['en'] = array(
1819 # for Special:Version
1920 'plotters-desc' => 'Lets users use custom JavaScript in jsplot tags',
2021
21 - # for Special:Gadgets
 22+ # for Special:Plotters
2223 'plotters' => 'Plotters',
2324 'plotters-title' => 'Plotters',
2425 'plotters-pagetext' => "Below is a list of special plotters users can use in their jsplot tags, as defined by [[MediaWiki:Plotters-definition]].
2526 This overview provides easy access to the system message pages that define each plotter's description and code.",
 27+
 28+ # for Special:Plotters-definition
2629 'plotters-uses' => 'Uses',
2730 'plotters-missing-script' => 'No script was defined.',
2831 'plotters-missing-arguments' => 'No arguments specified.',
29 - 'plotters-excessively-long-scriptname' => 'The script name is too long. Please define a script that is less than 255 characters.',
30 - 'plotters-excessively-long-preprocessorname' => 'The preprocessor name is too long. Please define a preprocessor that is less than 255 characters.',
31 - 'plotters-excessively-long-name' => 'The plot name is too long. Please define a plot name that is less than 255 characters.',
32 - 'plotters-excessively-long-tableclass' => 'The tableclass is too long. Please define a tableclass that is less than 255 characters.',
 32+ 'plotters-excessively-long-scriptname' => 'The script name is too long. Please define a script, the name of which is 255 characters long at most.',
 33+ 'plotters-excessively-long-preprocessorname' => 'The preprocessor name is too long. Please define a preprocessor, the name of which is 255 characters long at most.',
 34+ 'plotters-excessively-long-name' => 'The plot name is too long. Please define a plot name that has 255 characters at most.',
 35+ 'plotters-excessively-long-tableclass' => 'The tableclass is too long. Please define a tableclass that has 255 characters at most.',
3336 'plotters-no-data' => 'No data was provided.',
3437 'plotters-invalid-renderer' => 'An invalid renderer was selected.',
35 - 'plotters-errors' => '<b>Plotters error(s):</b>',
 38+ 'plotters-errors' => 'Plotters {{PLURAL:$1|error|errors}}:',
3639 );
3740
 41+/** Message Documentation.
 42+ * @author Purodha
 43+ */
 44+$messages['qqq'] = array(
 45+ 'plotters-desc' => 'Short description of the Plotters extension. Used on [[Special:Version]]. Do not translate link targets.',
 46+ 'plotters-errors' => 'Parameters:
 47+$1 = number of messages following. Can be used with PLURAL.',
 48+);
 49+
3850 /** Arabic (العربية)
3951 * @author Meno25
4052 */
Index: trunk/extensions/Plotters/PlottersClass.php
@@ -38,42 +38,50 @@
3939 wfLoadExtensionMessages( 'Plotters' );
4040
4141 $errors = '';
 42+ $errcnt = 0;
4243
4344 // Check for a valid renderer
4445 if ( $this->argumentArray["renderer"] != "generic" && $this->argumentArray["renderer"] != "plotkit" ) {
4546 $errors .= wfMsg( "plotters-invalid-renderer" ) . "<br />";
 47+ $errcnt++;
4648 }
4749
4850 // Check for a script
4951 if ( $this->argumentArray["script"] == "" ) {
5052 $errors .= wfMsg( "plotters-missing-script" ) . "<br />";
 53+ $errcnt++;
5154 } else if ( strlen( $this->argumentArray["script"] ) > 255 ) {
5255 // Check to ensure scriptname is < 255 characters
5356 $errors .= wfMsg( "plotters-excessively-long-scriptname" ) . "<br />";
 57+ $errcnt++;
5458 }
5559
5660 // Check preprocessors
5761 foreach ( $this->argumentArray["preprocessors"] as $preprocessor ) {
5862 if ( strlen( $preprocessor ) > 255 ) {
5963 $errors .= wfMsg( "plotters-excessively-long-preprocessorname" ) . "<br />";
 64+ $errcnt++;
6065 }
6166 }
6267
6368 if ( strlen( $this->argumentArray["name"] ) > 255 ) {
64 - $errors .= wfMsg( "plotters-excessively-long-name" ) . "<br />";
 69+ $errors .= wfMsg( "plotters-excessively-long-name" ) . "<br />";
 70+ $errcnt++;
6571 }
6672
6773 if ( strlen( $this->argumentArray["tableclass"] ) > 255 ) {
68 - $errors .= wfMsg( "plotters-excessively-long-tableclass" ) . "<br />";
 74+ $errors .= wfMsg( "plotters-excessively-long-tableclass" ) . "<br />";
 75+ $errcnt++;
6976 }
7077
7178 // Check for data
7279 if ( count( $this->dataArray ) == 0 ) {
7380 $errors .= wfMsg( "plotters-no-data" ) . "<br />";
 81+ $errcnt++;
7482 }
7583
7684 if ( $errors != '' ) {
77 - $this->errors = wfMsg( "plotters-errors" ) . " " . $errors;
 85+ $this->errors = '<b>' . wfMsgExt( 'plotters-errors', array('parse'), $errcnt ) . '</b> ' . $errors;
7886 }
7987 }
8088

Status & tagging log