Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -89,9 +89,29 @@ |
90 | 90 | |
91 | 91 | static function addTools( $object ) { |
92 | 92 | $object->editFormTextTop .= self::editBoxes( $object ); |
| 93 | + global $wgMessageCache, $wgLang; |
| 94 | + $wgMessageCache->addMessage( 'savearticle', "Save as {$wgLang->getCode()}", $wgLang->getCode() ); |
93 | 95 | return true; |
94 | 96 | } |
95 | 97 | |
| 98 | + static function buttonHack( $editpage, &$buttons, $tabindex ) { |
| 99 | + global $wgLang; |
| 100 | + list( , $code ) = self::figureMessage( $editpage->mTitle ); |
| 101 | + if ( $code !== 'qqq' ) return true; |
| 102 | + $name = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() ); |
| 103 | + $temp = array( |
| 104 | + 'id' => 'wpSave', |
| 105 | + 'name' => 'wpSave', |
| 106 | + 'type' => 'submit', |
| 107 | + 'tabindex' => ++$tabindex, |
| 108 | + 'value' => wfMsg( 'translate-save', $name ), |
| 109 | + 'accesskey' => wfMsg( 'accesskey-save' ), |
| 110 | + 'title' => wfMsg( 'tooltip-save' ).' ['.wfMsg( 'accesskey-save' ).']', |
| 111 | + ); |
| 112 | + $buttons['save'] = Xml::element('input', $temp, ''); |
| 113 | + return true; |
| 114 | + } |
| 115 | + |
96 | 116 | private static function getFallbacks( $code ) { |
97 | 117 | global $wgTranslateLanguageFallbacks, $wgTranslateDocumentationLanguageCode; |
98 | 118 | |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -46,6 +46,7 @@ |
47 | 47 | $wgHooks['EditPage::showEditForm:initial'][] = 'TranslateEditAddons::addTools'; |
48 | 48 | $wgHooks['OutputPageBeforeHTML'][] = 'TranslateEditAddons::addNavigation'; |
49 | 49 | $wgHooks['AlternateEdit'][] = 'TranslateEditAddons::intro'; |
| 50 | +$wgHooks['EditPageBeforeEditButtons'][] = 'TranslateEditAddons::buttonHack'; |
50 | 51 | |
51 | 52 | $wgHooks['UserToggles'][] = 'TranslatePreferences::TranslateUserToggles'; |
52 | 53 | $wgHooks['SpecialRecentChangesQuery'][] = 'TranslateRcFilter::translationFilter'; |
Index: trunk/extensions/Translate/MessageChecks.php |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | if ( $count = count( $missing ) ) { |
114 | 114 | global $wgLang; |
115 | 115 | $desc = array( 'translate-checks-parameters', |
116 | | - implode( ', ', $missing ), |
| 116 | + $wgLang->commalist( $missing ), |
117 | 117 | $wgLang->formatNum( $count ) ); |
118 | 118 | return true; |
119 | 119 | } |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | if ( $count = count( $missing ) ) { |
140 | 140 | global $wgLang; |
141 | 141 | $desc = array( 'translate-checks-parameters-unknown', |
142 | | - implode( ', ', $missing ), |
| 142 | + $wgLang->commalist( $missing ), |
143 | 143 | $wgLang->formatNum( $count ) ); |
144 | 144 | return true; |
145 | 145 | } |
— | — | @@ -174,7 +174,7 @@ |
175 | 175 | if ( $count = count( $balance ) ) { |
176 | 176 | global $wgLang; |
177 | 177 | $desc = array( 'translate-checks-balance', |
178 | | - implode( ', ', $balance ), |
| 178 | + $wgLang->commalist( $balance ), |
179 | 179 | $wgLang->formatNum( $count ) ); |
180 | 180 | return true; |
181 | 181 | } |
— | — | @@ -213,7 +213,7 @@ |
214 | 214 | if ( $count = count( $links ) ) { |
215 | 215 | global $wgLang; |
216 | 216 | $desc = array( 'translate-checks-links', |
217 | | - implode( ', ', $links ), |
| 217 | + $wgLang->commalist( $links ), |
218 | 218 | $wgLang->formatNum( $count ) ); |
219 | 219 | return true; |
220 | 220 | } |
— | — | @@ -253,7 +253,7 @@ |
254 | 254 | if ( $count = count( $wrongTags ) ) { |
255 | 255 | global $wgLang; |
256 | 256 | $desc = array( 'translate-checks-xhtml', |
257 | | - implode( ', ', $wrongTags ), |
| 257 | + $wgLang->commalist( $wrongTags ), |
258 | 258 | $wgLang->formatNum( $count ) ); |
259 | 259 | return true; |
260 | 260 | } |
— | — | @@ -358,7 +358,7 @@ |
359 | 359 | if ( $count = count( $missing ) ) { |
360 | 360 | global $wgLang; |
361 | 361 | $desc = array( 'translate-checks-parameters', |
362 | | - implode( ', ', $missing ), |
| 362 | + $wgLang->commaList( $missing ), |
363 | 363 | $wgLang->formatNum( $count ) ); |
364 | 364 | return true; |
365 | 365 | } else { |
— | — | @@ -384,7 +384,7 @@ |
385 | 385 | if ( $count = count( $missing ) ) { |
386 | 386 | global $wgLang; |
387 | 387 | $desc = array( 'translate-checks-parameters-unknown', |
388 | | - implode( ', ', $missing ), |
| 388 | + $wgLang->commaList( $missing ), |
389 | 389 | $wgLang->formatNum( $count ) ); |
390 | 390 | return true; |
391 | 391 | } else { |
— | — | @@ -397,8 +397,9 @@ |
398 | 398 | preg_match_all( "/$varPattern/U", $message->translation, $transVars ); |
399 | 399 | |
400 | 400 | if ( $count = count( $transVars[0] ) ) { |
| 401 | + global $wgLang; |
401 | 402 | $desc = array( 'translate-checks-escape', |
402 | | - '<tt><nowiki>' . implode( ', ', $transVars[0] ) . '</nowiki></tt>' ); |
| 403 | + '<tt><nowiki>' . $wgLang->commaList( $transVars[0] ) . '</nowiki></tt>' ); |
403 | 404 | return true; |
404 | 405 | } else { |
405 | 406 | return false; |
— | — | @@ -423,7 +424,7 @@ |
424 | 425 | if ( $count = count( $missing ) ) { |
425 | 426 | global $wgLang; |
426 | 427 | $desc = array( 'translate-checks-parameters', |
427 | | - implode( ', ', $missing ), |
| 428 | + $wgLang->commaList( $missing ), |
428 | 429 | $wgLang->formatNum( $count ) ); |
429 | 430 | return true; |
430 | 431 | } else { |
— | — | @@ -447,7 +448,7 @@ |
448 | 449 | if ( $count = count( $missing ) ) { |
449 | 450 | global $wgLang; |
450 | 451 | $desc = array( 'translate-checks-parameters-unknown', |
451 | | - implode( ', ', $missing ), |
| 452 | + $wgLang->commaList( $missing ), |
452 | 453 | $wgLang->formatNum( $count ) ); |
453 | 454 | return true; |
454 | 455 | } else { |
— | — | @@ -473,7 +474,7 @@ |
474 | 475 | if ( $count = count( $missing ) ) { |
475 | 476 | global $wgLang; |
476 | 477 | $desc = array( 'translate-checks-parameters', |
477 | | - implode( ', ', $missing ), |
| 478 | + $wgLang->commaList( $missing ), |
478 | 479 | $wgLang->formatNum( $count ) ); |
479 | 480 | return true; |
480 | 481 | } else { |
— | — | @@ -497,7 +498,7 @@ |
498 | 499 | if ( $count = count( $missing ) ) { |
499 | 500 | global $wgLang; |
500 | 501 | $desc = array( 'translate-checks-parameters-unknown', |
501 | | - implode( ', ', $missing ), |
| 502 | + $wgLang->commaList( $missing ), |
502 | 503 | $wgLang->formatNum( $count ) ); |
503 | 504 | return true; |
504 | 505 | } else { |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -195,6 +195,8 @@ |
196 | 196 | 'translate-languagestats-groups' => ' # Add message group IDs, one per line to restrict the message groups that |
197 | 197 | # are shown on Special:LanguageStats. Non-existing message group IDs will |
198 | 198 | # be ignored.', # do not duplicate this message to other languages |
| 199 | + |
| 200 | + 'translate-save' => 'Save ($1)', |
199 | 201 | ); |
200 | 202 | |
201 | 203 | /** Message documentation (Message documentation) |