Index: trunk/extensions/Plotters/Plotters.i18n.php |
— | — | @@ -12,28 +12,40 @@ |
13 | 13 | |
14 | 14 | /** English |
15 | 15 | * @author Ryan Lane, rlane32+mwext@gmail.com |
| 16 | + * @author Purodha |
16 | 17 | */ |
17 | 18 | $messages['en'] = array( |
18 | 19 | # for Special:Version |
19 | 20 | 'plotters-desc' => 'Lets users use custom JavaScript in jsplot tags', |
20 | 21 | |
21 | | - # for Special:Gadgets |
| 22 | + # for Special:Plotters |
22 | 23 | 'plotters' => 'Plotters', |
23 | 24 | 'plotters-title' => 'Plotters', |
24 | 25 | 'plotters-pagetext' => "Below is a list of special plotters users can use in their jsplot tags, as defined by [[MediaWiki:Plotters-definition]]. |
25 | 26 | This overview provides easy access to the system message pages that define each plotter's description and code.", |
| 27 | + |
| 28 | + # for Special:Plotters-definition |
26 | 29 | 'plotters-uses' => 'Uses', |
27 | 30 | 'plotters-missing-script' => 'No script was defined.', |
28 | 31 | '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.', |
33 | 36 | 'plotters-no-data' => 'No data was provided.', |
34 | 37 | 'plotters-invalid-renderer' => 'An invalid renderer was selected.', |
35 | | - 'plotters-errors' => '<b>Plotters error(s):</b>', |
| 38 | + 'plotters-errors' => 'Plotters {{PLURAL:$1|error|errors}}:', |
36 | 39 | ); |
37 | 40 | |
| 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 | + |
38 | 50 | /** Arabic (العربية) |
39 | 51 | * @author Meno25 |
40 | 52 | */ |
Index: trunk/extensions/Plotters/PlottersClass.php |
— | — | @@ -38,42 +38,50 @@ |
39 | 39 | wfLoadExtensionMessages( 'Plotters' ); |
40 | 40 | |
41 | 41 | $errors = ''; |
| 42 | + $errcnt = 0; |
42 | 43 | |
43 | 44 | // Check for a valid renderer |
44 | 45 | if ( $this->argumentArray["renderer"] != "generic" && $this->argumentArray["renderer"] != "plotkit" ) { |
45 | 46 | $errors .= wfMsg( "plotters-invalid-renderer" ) . "<br />"; |
| 47 | + $errcnt++; |
46 | 48 | } |
47 | 49 | |
48 | 50 | // Check for a script |
49 | 51 | if ( $this->argumentArray["script"] == "" ) { |
50 | 52 | $errors .= wfMsg( "plotters-missing-script" ) . "<br />"; |
| 53 | + $errcnt++; |
51 | 54 | } else if ( strlen( $this->argumentArray["script"] ) > 255 ) { |
52 | 55 | // Check to ensure scriptname is < 255 characters |
53 | 56 | $errors .= wfMsg( "plotters-excessively-long-scriptname" ) . "<br />"; |
| 57 | + $errcnt++; |
54 | 58 | } |
55 | 59 | |
56 | 60 | // Check preprocessors |
57 | 61 | foreach ( $this->argumentArray["preprocessors"] as $preprocessor ) { |
58 | 62 | if ( strlen( $preprocessor ) > 255 ) { |
59 | 63 | $errors .= wfMsg( "plotters-excessively-long-preprocessorname" ) . "<br />"; |
| 64 | + $errcnt++; |
60 | 65 | } |
61 | 66 | } |
62 | 67 | |
63 | 68 | if ( strlen( $this->argumentArray["name"] ) > 255 ) { |
64 | | - $errors .= wfMsg( "plotters-excessively-long-name" ) . "<br />"; |
| 69 | + $errors .= wfMsg( "plotters-excessively-long-name" ) . "<br />"; |
| 70 | + $errcnt++; |
65 | 71 | } |
66 | 72 | |
67 | 73 | if ( strlen( $this->argumentArray["tableclass"] ) > 255 ) { |
68 | | - $errors .= wfMsg( "plotters-excessively-long-tableclass" ) . "<br />"; |
| 74 | + $errors .= wfMsg( "plotters-excessively-long-tableclass" ) . "<br />"; |
| 75 | + $errcnt++; |
69 | 76 | } |
70 | 77 | |
71 | 78 | // Check for data |
72 | 79 | if ( count( $this->dataArray ) == 0 ) { |
73 | 80 | $errors .= wfMsg( "plotters-no-data" ) . "<br />"; |
| 81 | + $errcnt++; |
74 | 82 | } |
75 | 83 | |
76 | 84 | if ( $errors != '' ) { |
77 | | - $this->errors = wfMsg( "plotters-errors" ) . " " . $errors; |
| 85 | + $this->errors = '<b>' . wfMsgExt( 'plotters-errors', array('parse'), $errcnt ) . '</b> ' . $errors; |
78 | 86 | } |
79 | 87 | } |
80 | 88 | |