Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -2346,6 +2346,21 @@ |
2347 | 2347 | 'CoreParserFunctions' => array( |
2348 | 2348 | 'unknown_extension_tag', |
2349 | 2349 | ), |
| 2350 | + 'version' => array( |
| 2351 | + 'version-extensions', |
| 2352 | + 'version-specialpages', |
| 2353 | + 'version-parserhooks', |
| 2354 | + 'version-variables', |
| 2355 | + 'version-other', |
| 2356 | + 'version-hooks', |
| 2357 | + 'version-extension-functions', |
| 2358 | + 'version-parser-extensiontags', |
| 2359 | + 'version-parser-function-hooks', |
| 2360 | + 'version-skin-extension-functions', |
| 2361 | + 'version-hook-name', |
| 2362 | + 'version-hook-subscribedby', |
| 2363 | + 'version-and', |
| 2364 | + ), |
2350 | 2365 | ); |
2351 | 2366 | /** Comments for each block */ |
2352 | 2367 | $wgBlockComments = array( |
— | — | @@ -2521,6 +2536,7 @@ |
2522 | 2537 | 'hebrew-dates' => 'Hebrew month names', |
2523 | 2538 | 'signatures' => 'Signatures', |
2524 | 2539 | 'CoreParserFunctions' => 'Core parser functions', |
| 2540 | + 'version' => 'Special:Version', |
2525 | 2541 | ); |
2526 | 2542 | |
2527 | 2543 | /** Short comments for standalone messages */ |
Index: trunk/phase3/includes/SpecialVersion.php |
— | — | @@ -24,7 +24,8 @@ |
25 | 25 | * main() |
26 | 26 | */ |
27 | 27 | function execute() { |
28 | | - global $wgOut; |
| 28 | + global $wgOut, $wgMessageCache; |
| 29 | + $wgMessageCache->loadAllMessages(); |
29 | 30 | |
30 | 31 | $wgOut->addHTML( '<div dir="ltr">' ); |
31 | 32 | $wgOut->addWikiText( |
— | — | @@ -96,16 +97,16 @@ |
97 | 98 | return ''; |
98 | 99 | |
99 | 100 | $extensionTypes = array( |
100 | | - 'specialpage' => 'Special pages', |
101 | | - 'parserhook' => 'Parser hooks', |
102 | | - 'variable' => 'Variables', |
103 | | - 'media' => 'Media handlers', |
104 | | - 'other' => 'Other', |
| 101 | + 'specialpage' => wfMsg( 'version-specialpages' ), |
| 102 | + 'parserhook' => wfMsg( 'version-parserhooks' ), |
| 103 | + 'variable' => wfMsg( 'version-variables' ), |
| 104 | + 'media' => wfMsg( 'version-mediahandlers' ), |
| 105 | + 'other' => wfMsg( 'version-other' ), |
105 | 106 | ); |
106 | 107 | wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) ); |
107 | 108 | |
108 | | - $out = "<h2>Extensions</h2>\n"; |
109 | | - $out .= Xml::openElement('table', array('id' => 'sv-ext') ); |
| 109 | + $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), wfMsg( 'version-extensions' ) ) . |
| 110 | + Xml::openElement( 'table', array( 'id' => 'sv-ext' ) ); |
110 | 111 | |
111 | 112 | foreach ( $extensionTypes as $type => $text ) { |
112 | 113 | if ( isset ( $wgExtensionCredits[$type] ) && count ( $wgExtensionCredits[$type] ) ) { |
— | — | @@ -115,35 +116,36 @@ |
116 | 117 | |
117 | 118 | foreach ( $wgExtensionCredits[$type] as $extension ) { |
118 | 119 | $out .= $this->formatCredits( |
119 | | - isset ( $extension['name'] ) ? $extension['name'] : '', |
120 | | - isset ( $extension['version'] ) ? $extension['version'] : null, |
121 | | - isset ( $extension['author'] ) ? $extension['author'] : '', |
122 | | - isset ( $extension['url'] ) ? $extension['url'] : null, |
123 | | - isset ( $extension['description'] ) ? $extension['description'] : '' |
| 120 | + isset ( $extension['name'] ) ? $extension['name'] : '', |
| 121 | + isset ( $extension['version'] ) ? $extension['version'] : null, |
| 122 | + isset ( $extension['author'] ) ? $extension['author'] : '', |
| 123 | + isset ( $extension['url'] ) ? $extension['url'] : null, |
| 124 | + isset ( $extension['description'] ) ? $extension['description'] : '', |
| 125 | + isset ( $extension['descriptionmsg'] ) ? $extension['descriptionmsg'] : '' |
124 | 126 | ); |
125 | 127 | } |
126 | 128 | } |
127 | 129 | } |
128 | 130 | |
129 | 131 | if ( count( $wgExtensionFunctions ) ) { |
130 | | - $out .= $this->openExtType('Extension functions'); |
| 132 | + $out .= $this->openExtType( wfMsg( 'version-extension-functions' ) ); |
131 | 133 | $out .= '<tr><td colspan="3">' . $this->listToText( $wgExtensionFunctions ) . "</td></tr>\n"; |
132 | 134 | } |
133 | 135 | |
134 | 136 | if ( $cnt = count( $tags = $wgParser->getTags() ) ) { |
135 | 137 | for ( $i = 0; $i < $cnt; ++$i ) |
136 | 138 | $tags[$i] = "<{$tags[$i]}>"; |
137 | | - $out .= $this->openExtType('Parser extension tags'); |
| 139 | + $out .= $this->openExtType( wfMsg( 'version-parser-extensiontags' ) ); |
138 | 140 | $out .= '<tr><td colspan="3">' . $this->listToText( $tags ). "</td></tr>\n"; |
139 | 141 | } |
140 | 142 | |
141 | 143 | if( $cnt = count( $fhooks = $wgParser->getFunctionHooks() ) ) { |
142 | | - $out .= $this->openExtType('Parser function hooks'); |
| 144 | + $out .= $this->openExtType( wfMsg( 'version-parser-function-hooks' ) ); |
143 | 145 | $out .= '<tr><td colspan="3">' . $this->listToText( $fhooks ) . "</td></tr>\n"; |
144 | 146 | } |
145 | 147 | |
146 | 148 | if ( count( $wgSkinExtensionFunction ) ) { |
147 | | - $out .= $this->openExtType('Skin extension functions'); |
| 149 | + $out .= $this->openExtType( wfMsg( 'version-skin-extension-functions' ) ); |
148 | 150 | $out .= '<tr><td colspan="3">' . $this->listToText( $wgSkinExtensionFunction ) . "</td></tr>\n"; |
149 | 151 | } |
150 | 152 | $out .= Xml::closeElement( 'table' ); |
— | — | @@ -162,21 +164,23 @@ |
163 | 165 | } |
164 | 166 | } |
165 | 167 | |
166 | | - function formatCredits( $name, $version = null, $author = null, $url = null, $description = null) { |
167 | | - $ret = '<tr><td>'; |
168 | | - if ( isset( $url ) ) |
169 | | - $ret .= "[$url "; |
170 | | - $ret .= "''$name"; |
171 | | - if ( isset( $version ) ) |
172 | | - $ret .= " (version $version)"; |
173 | | - $ret .= "''"; |
174 | | - if ( isset( $url ) ) |
175 | | - $ret .= ']'; |
176 | | - $ret .= '</td>'; |
177 | | - $ret .= "<td>$description</td>"; |
178 | | - $ret .= "<td>" . $this->listToText( (array)$author ) . "</td>"; |
179 | | - $ret .= '</tr>'; |
180 | | - return "$ret\n"; |
| 168 | + function formatCredits( $name, $version = null, $author = null, $url = null, $description = null, $descriptionMsg = null ) { |
| 169 | + $extension = isset( $url ) ? "[$url $name]" : $name; |
| 170 | + $version = isset( $version ) ? "(" . wfMsg( 'version-version' ) . " $version)" : ''; |
| 171 | + |
| 172 | + # Look for a localized description |
| 173 | + if( isset( $descriptionMsg ) ) { |
| 174 | + $msg = wfMsg( $descriptionMsg ); |
| 175 | + if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != '' ) { |
| 176 | + $description = $msg; |
| 177 | + } |
| 178 | + } |
| 179 | + |
| 180 | + return "<tr> |
| 181 | + <td><em>$extension $version</em></td> |
| 182 | + <td>$description</td> |
| 183 | + <td>" . $this->listToText( (array)$author ) . "</td> |
| 184 | + </tr>\n"; |
181 | 185 | } |
182 | 186 | |
183 | 187 | /** |
— | — | @@ -189,12 +193,18 @@ |
190 | 194 | $myWgHooks = $wgHooks; |
191 | 195 | ksort( $myWgHooks ); |
192 | 196 | |
193 | | - $ret = "<h2>Hooks</h2>\n" |
194 | | - . Xml::openElement('table', array('id' => 'sv-hooks') ) |
195 | | - . "<tr><th>Hook name</th><th>Subscribed by</th></tr>\n"; |
| 197 | + $ret = Xml::element( 'h2', array( 'id' => 'mw-version-hooks' ), wfMsg( 'version-hooks' ) ) . |
| 198 | + Xml::openElement( 'table', array( 'id' => 'sv-hooks' ) ) . |
| 199 | + "<tr> |
| 200 | + <th>" . wfMsg( 'version-hook-name' ) . "</th> |
| 201 | + <th>" . wfMsg( 'version-hook-subscribedby' ) . "</th> |
| 202 | + </tr>\n"; |
196 | 203 | |
197 | | - foreach ($myWgHooks as $hook => $hooks) |
198 | | - $ret .= "<tr><td>$hook</td><td>" . $this->listToText( $hooks ) . "</td></tr>\n"; |
| 204 | + foreach ( $myWgHooks as $hook => $hooks ) |
| 205 | + $ret .= "<tr> |
| 206 | + <td>$hook</td> |
| 207 | + <td>" . $this->listToText( $hooks ) . "</td> |
| 208 | + </tr>\n"; |
199 | 209 | |
200 | 210 | $ret .= Xml::closeElement( 'table' ); |
201 | 211 | return $ret; |
— | — | @@ -235,20 +245,21 @@ |
236 | 246 | */ |
237 | 247 | function listToText( $list ) { |
238 | 248 | $cnt = count( $list ); |
239 | | - sort( $list ); |
240 | 249 | |
241 | | - if ( $cnt == 1 ) { |
| 250 | + if ( $cnt == 1 ) { |
242 | 251 | // Enforce always returning a string |
243 | 252 | return (string)$this->arrayToString( $list[0] ); |
244 | | - } elseif ( $cnt == 0 ) { |
| 253 | + } elseif ( $cnt == 0 ) { |
245 | 254 | return ''; |
246 | 255 | } else { |
| 256 | + sort( $list ); |
247 | 257 | $t = array_slice( $list, 0, $cnt - 1 ); |
248 | 258 | $one = array_map( array( &$this, 'arrayToString' ), $t ); |
249 | 259 | $two = $this->arrayToString( $list[$cnt - 1] ); |
| 260 | + $and = wfMsg( 'version-and' ); |
250 | 261 | |
251 | | - return implode( ', ', $one ) . " and $two"; |
252 | | - } |
| 262 | + return implode( ', ', $one ) . " $and $two"; |
| 263 | + } |
253 | 264 | } |
254 | 265 | |
255 | 266 | /** |
— | — | @@ -321,3 +332,4 @@ |
322 | 333 | |
323 | 334 | /**#@-*/ |
324 | 335 | |
| 336 | + |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -3135,4 +3135,20 @@ |
3136 | 3136 | # Core parser functions |
3137 | 3137 | 'unknown_extension_tag' => 'Unknown extension tag "$1"', |
3138 | 3138 | |
| 3139 | +# Special:Version |
| 3140 | +'version-extensions' => 'Installed extensions', |
| 3141 | +'version-specialpages' => 'Special pages', |
| 3142 | +'version-parserhooks' => 'Parser hooks', |
| 3143 | +'version-variables' => 'Variables', |
| 3144 | +'version-other' => 'Other', |
| 3145 | +'version-mediahandlers' => 'Media handlers', |
| 3146 | +'version-hooks' => 'Hooks', |
| 3147 | +'version-extension-functions' => 'Extension functions', |
| 3148 | +'version-parser-extensiontags' => 'Parser extension tags', |
| 3149 | +'version-parser-function-hooks' => 'Parser function hooks', |
| 3150 | +'version-skin-extension-functions' => 'Skin extension functions', |
| 3151 | +'version-hook-name' => 'Hook name', |
| 3152 | +'version-hook-subscribedby' => 'Subscribed by', |
| 3153 | +'version-and' => 'and', |
| 3154 | +'version-version' => 'Version', |
3139 | 3155 | ); |
Index: trunk/phase3/languages/messages/MessagesDe.php |
— | — | @@ -2482,4 +2482,20 @@ |
2483 | 2483 | # Core parser functions |
2484 | 2484 | 'unknown_extension_tag' => 'Unbekannter Extension-Tag „$1“', |
2485 | 2485 | |
| 2486 | +# Special:Version |
| 2487 | +'version-extensions' => 'Installierte Erweiterungen', |
| 2488 | +'version-specialpages' => 'Spezialseiten', |
| 2489 | +'version-parserhooks' => 'Parser-Hooks', |
| 2490 | +'version-variables' => 'Variablen', |
| 2491 | +'version-other' => 'Anderes', |
| 2492 | +'version-mediahandlers' => 'Medien-Handler', |
| 2493 | +'version-hooks' => "Schnittstellen ''(Hooks)''", |
| 2494 | +'version-extension-functions' => 'Funktionsaufrufe', |
| 2495 | +'version-parser-extensiontags' => "Parser-Erweiterungen ''(tags)''", |
| 2496 | +'version-parser-function-hooks' => 'Parser-Funktionen', |
| 2497 | +'version-skin-extension-functions' => 'Skin-Erweiterungs-Funktionen', |
| 2498 | +'version-hook-name' => 'Schnittstellenname', |
| 2499 | +'version-hook-subscribedby' => 'Aufruf von', |
| 2500 | +'version-and' => 'und', |
| 2501 | +'version-version' => 'Version', |
2486 | 2502 | ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -147,8 +147,8 @@ |
148 | 148 | Both now accept namespace prefixes, handle 'Media:' and 'Special:' pages, |
149 | 149 | and reject interwiki prefixes. PrefixSearch class centralizes this code, |
150 | 150 | and the backend part can be overridden by the PrefixSearchBackend hook. |
| 151 | +* (bug 10365) Localization of Special:Version |
151 | 152 | |
152 | | - |
153 | 153 | === Bug fixes in 1.12 === |
154 | 154 | |
155 | 155 | * Subpages are now indexed for searching properly when using PostgreSQL |
Index: trunk/extensions/Cite/Cite.i18n.php |
— | — | @@ -8,10 +8,10 @@ |
9 | 9 | $messages = array(); |
10 | 10 | |
11 | 11 | $messages['en'] = array( |
| 12 | + 'cite_desc' => 'Adds <nowiki><ref[ name=id]></nowiki> and <nowiki><references/></nowiki> tags, for citations', |
12 | 13 | /* |
13 | 14 | Debug and errors |
14 | 15 | */ |
15 | | - |
16 | 16 | # Internal errors |
17 | 17 | 'cite_croak' => 'Cite croaked; $1: $2', |
18 | 18 | 'cite_error_key_str_invalid' => 'Internal error; invalid $str and/or $key. This should never occur.', |
— | — | @@ -179,6 +179,7 @@ |
180 | 180 | * @author Raimond Spekking |
181 | 181 | */ |
182 | 182 | $messages['de'] = array( |
| 183 | + 'cite_desc' => 'Ergänzt für Quellennachweise die <nowiki><ref[ name=id]></nowiki> und <nowiki><references/></nowiki> Tags', |
183 | 184 | 'cite_croak' => 'Fehler im Referenz-System. $1: $2', |
184 | 185 | 'cite_error_key_str_invalid' => 'Interner Fehler: ungültiger $str und/oder $key. Dies sollte eigentlich gar nicht passieren können.', |
185 | 186 | 'cite_error_stack_invalid_input' => 'Interner Fehler: ungültiger „name“-stack. Dies sollte eigentlich gar nicht passieren können.', |
Index: trunk/extensions/Cite/SpecialCite.i18n.php |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | $messages = array(); |
10 | 10 | |
11 | 11 | $messages['en'] = array( |
| 12 | + 'cite_article_desc' => 'Adds a [[Special:Cite|citation]] special page & toolbox link', |
12 | 13 | 'cite_article_link' => 'Cite this page', |
13 | 14 | 'cite' => 'Cite', |
14 | 15 | 'cite_page' => 'Page:', |
— | — | @@ -170,6 +171,7 @@ |
171 | 172 | ); |
172 | 173 | |
173 | 174 | $messages['de'] = array( |
| 175 | + 'cite_article_desc' => 'Ergänzt die [[Special:Cite|Zitierhilfe]]-Spezialseite und einen Link im Kasten Werkzeuge', |
174 | 176 | 'cite_article_link' => 'Seite zitieren', |
175 | 177 | 'cite' => 'Zitierhilfe', |
176 | 178 | 'cite_page' => 'Seite:', |
Index: trunk/extensions/Cite/Cite.php |
— | — | @@ -21,8 +21,10 @@ |
22 | 22 | $wgExtensionFunctions[] = 'wfCite'; |
23 | 23 | $wgExtensionCredits['parserhook'][] = array( |
24 | 24 | 'name' => 'Cite', |
| 25 | + 'version' => '2008-01-31', |
25 | 26 | 'author' => 'Ævar Arnfjörð Bjarmason', |
26 | | - 'description' => 'Adds <nowiki><ref[ name=id]></nowiki> and <nowiki><references/></nowiki> tags, for citations', |
| 27 | + 'description' => 'Adds <nowiki><ref[ name=id]></nowiki> and <nowiki><references/></nowiki> tags, for citations', // kept for b/c |
| 28 | + 'descriptionmsg' => 'cite_desc', |
27 | 29 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Cite/Cite.php' |
28 | 30 | ); |
29 | 31 | $wgParserTestFiles[] = dirname( __FILE__ ) . "/citeParserTests.txt"; |
— | — | @@ -662,4 +664,3 @@ |
663 | 665 | |
664 | 666 | /**#@-*/ |
665 | 667 | |
666 | | - |
Index: trunk/extensions/Cite/SpecialCite.php |
— | — | @@ -15,9 +15,10 @@ |
16 | 16 | |
17 | 17 | $wgExtensionCredits['specialpage'][] = array( |
18 | 18 | 'name' => 'Cite', |
19 | | - 'version' => '2008-01-09', |
| 19 | + 'version' => '2008-01-31', |
20 | 20 | 'author' => 'Ævar Arnfjörð Bjarmason', |
21 | | - 'description' => 'adds a [[Special:Cite|citation]] special page & toolbox link', |
| 21 | + 'description' => 'adds a [[Special:Cite|citation]] special page & toolbox link', // kept for b/c |
| 22 | + 'descriptionmsg' => 'cite_article_desc', |
22 | 23 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Cite/Special:Cite.php' |
23 | 24 | ); |
24 | 25 | |