Index: branches/wmf/1.18wmf1/extensions/Translate/Translate.php |
— | — | @@ -165,6 +165,11 @@ |
166 | 166 | 'position' => 'top', |
167 | 167 | ) + $resourcePaths; |
168 | 168 | |
| 169 | +$wgResourceModules['ext.translate.helplink'] = array( |
| 170 | + 'styles' => 'resources/ext.translate.helplink.css', |
| 171 | + 'position' => 'top', |
| 172 | +) + $resourcePaths; |
| 173 | + |
169 | 174 | $wgResourceModules['ext.translate.messagetable'] = array( |
170 | 175 | 'scripts' => 'resources/ext.translate.messagetable.js', |
171 | 176 | 'styles' => 'resources/ext.translate.messagetable.css', |
Index: branches/wmf/1.18wmf1/extensions/Translate/Translate.i18n.php |
— | — | @@ -426,6 +426,8 @@ |
427 | 427 | 'translate-dynagroup-byc' => 'Translation made by {{GENDER:$1|$1}} ($2)', |
428 | 428 | 'translate-dynagroup-last' => 'Latest change by {{GENDER:$1|$1}}', |
429 | 429 | 'translate-dynagroup-lastc' => 'Latest change by {{GENDER:$1|$1}} ($2)', |
| 430 | + |
| 431 | + 'translate-gethelp' => 'Help', |
430 | 432 | ); |
431 | 433 | |
432 | 434 | /** Message documentation (Message documentation) |
— | — | @@ -685,6 +687,8 @@ |
686 | 688 | 'translate-workflow-set-done' => 'Submit button text when submission completed succesfully', |
687 | 689 | 'translate-workflow-autocreated-summary' => 'This is an edit summary for the automatic creation of a workflow state page.', |
688 | 690 | 'translate-stats-workflow' => 'Column header on Special:LanguageStats and Special:MessageGroupStats', |
| 691 | + |
| 692 | + 'translate-gethelp' => 'Link to some Translate help page or tutorial', |
689 | 693 | ); |
690 | 694 | |
691 | 695 | /** Faeag Rotuma (Faeag Rotuma) |
Index: branches/wmf/1.18wmf1/extensions/Translate/specials/SpecialManageGroups.php |
— | — | @@ -92,6 +92,7 @@ |
93 | 93 | |
94 | 94 | $groups = MessageGroups::singleton()->getGroups(); |
95 | 95 | |
| 96 | + TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Group_management' ); |
96 | 97 | $wgOut->wrapWikiMsg( '<h2>$1</h2>', 'translate-manage-listgroups' ); |
97 | 98 | $separator = wfMsg( 'word-separator' ); |
98 | 99 | |
Index: branches/wmf/1.18wmf1/extensions/Translate/specials/SpecialImportTranslations.php |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | global $wgOut; |
122 | 122 | |
123 | 123 | $wgOut->addModules( 'ext.translate.special.importtranslations' ); |
124 | | - |
| 124 | + TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Off-line_translation' ); |
125 | 125 | /** |
126 | 126 | * Ugly but necessary form building ahead, ohoy |
127 | 127 | */ |
Index: branches/wmf/1.18wmf1/extensions/Translate/specials/SpecialSupportedLanguages.php |
— | — | @@ -36,6 +36,7 @@ |
37 | 37 | $this->purge = $wgRequest->getVal( 'action' ) === 'purge'; |
38 | 38 | |
39 | 39 | $this->setHeaders(); |
| 40 | + TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Statistics_and_reporting#List_of_languages_and_translators' ); |
40 | 41 | $wgOut->addModules( 'ext.translate.special.supportedlanguages' ); |
41 | 42 | |
42 | 43 | $cache = wfGetCache( CACHE_ANYTHING ); |
Index: branches/wmf/1.18wmf1/extensions/Translate/specials/SpecialTranslate.php |
— | — | @@ -60,6 +60,7 @@ |
61 | 61 | $errors = array(); |
62 | 62 | |
63 | 63 | if ( $this->options['group'] === '' ) { |
| 64 | + TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Translation_example' ); |
64 | 65 | $this->groupInformation(); |
65 | 66 | return; |
66 | 67 | } |
— | — | @@ -81,6 +82,7 @@ |
82 | 83 | $this->options['group'] = $this->defaults['group']; |
83 | 84 | } |
84 | 85 | |
| 86 | + TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate' ); |
85 | 87 | // Show errors nicely. |
86 | 88 | $wgOut->addHTML( $this->settingsForm( $errors ) ); |
87 | 89 | |
Index: branches/wmf/1.18wmf1/extensions/Translate/specials/SpecialTranslationStats.php |
— | — | @@ -115,6 +115,7 @@ |
116 | 116 | global $wgOut, $wgScript; |
117 | 117 | |
118 | 118 | $this->setHeaders(); |
| 119 | + TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Statistics_and_reporting' ); |
119 | 120 | $wgOut->addWikiMsg( 'translate-statsf-intro' ); |
120 | 121 | |
121 | 122 | $wgOut->addHTML( |
Index: branches/wmf/1.18wmf1/extensions/Translate/specials/SpecialMagic.php |
— | — | @@ -138,6 +138,7 @@ |
139 | 139 | |
140 | 140 | $this->setup( $parameters ); |
141 | 141 | $this->setHeaders(); |
| 142 | + TranslateUtils::addSpecialHelpLink( $wgOut, '//translatewiki.net/wiki/FAQ#Special:AdvancedTranslate', true ); |
142 | 143 | |
143 | 144 | $wgOut->addHTML( $this->getForm() ); |
144 | 145 | |
Index: branches/wmf/1.18wmf1/extensions/Translate/specials/SpecialTranslations.php |
— | — | @@ -30,7 +30,6 @@ |
31 | 31 | |
32 | 32 | $this->setHeaders(); |
33 | 33 | $this->outputHeader(); |
34 | | - |
35 | 34 | self::includeAssets(); |
36 | 35 | |
37 | 36 | if ( $this->including() ) { |
— | — | @@ -54,7 +53,7 @@ |
55 | 54 | } else { |
56 | 55 | $title = Title::newFromText( $par, $namespace ); |
57 | 56 | } |
58 | | - |
| 57 | + TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Statistics_and_reporting#Translations_in_all_languages' ); |
59 | 58 | if ( !$title ) { |
60 | 59 | $title = Title::makeTitle( NS_MEDIAWIKI, '' ); |
61 | 60 | $wgOut->addHTML( $this->namespaceMessageForm( $title ) ); |
Index: branches/wmf/1.18wmf1/extensions/Translate/specials/SpecialLanguageStats.php |
— | — | @@ -120,6 +120,7 @@ |
121 | 121 | } |
122 | 122 | |
123 | 123 | if ( !$this->including() ) { |
| 124 | + TranslateUtils::addSpecialHelpLink( $wgOut, 'Help:Extension:Translate/Statistics_and_reporting' ); |
124 | 125 | $wgOut->addHTML( $this->getForm() ); |
125 | 126 | } |
126 | 127 | |
Index: branches/wmf/1.18wmf1/extensions/Translate/TranslateUtils.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | * |
6 | 6 | * @file |
7 | 7 | * @author Niklas Laxström |
8 | | - * @copyright Copyright © 2007, 2009 Niklas Laxström |
| 8 | + * @copyright Copyright © 2007, 2012 Niklas Laxström |
9 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
10 | 10 | */ |
11 | 11 | |
— | — | @@ -312,4 +312,27 @@ |
313 | 313 | return $selector; |
314 | 314 | } |
315 | 315 | |
| 316 | + /** |
| 317 | + * @since 2012-01-12 |
| 318 | + */ |
| 319 | + public static function addSpecialHelpLink( OutputPage $out, /*string*/$to, $overrideBaseUrl = false ) { |
| 320 | + $out->addModules( 'ext.translate.helplink' ); |
| 321 | + $text = wfMessage( 'translate-gethelp' )->escaped(); |
| 322 | + |
| 323 | + if( $overrideBaseUrl ) { |
| 324 | + $helpUrl = $to; |
| 325 | + } else { |
| 326 | + $helpUrl = "//www.mediawiki.org/wiki/Special:MyLanguage/$to"; |
| 327 | + } |
| 328 | + |
| 329 | + $link = Html::rawElement( |
| 330 | + 'a', |
| 331 | + array( |
| 332 | + 'href' => $helpUrl, |
| 333 | + 'target' => '_blank' |
| 334 | + ), |
| 335 | + "$text" ); |
| 336 | + $wrapper = Html::rawElement( 'div', array( 'class' => 'mw-translate-helplink' ), $link ); |
| 337 | + $out->addHtml( $wrapper ); |
| 338 | + } |
316 | 339 | } |
Index: branches/wmf/1.18wmf1/extensions/Translate/resources/ext.translate.helplink.css |
— | — | @@ -0,0 +1,14 @@ |
| 2 | +.mw-translate-helplink { |
| 3 | + position: absolute; |
| 4 | + width: 100%; |
| 5 | + display: block; |
| 6 | + margin-top: -10px; |
| 7 | +} |
| 8 | + |
| 9 | +.mw-translate-helplink a { |
| 10 | + /* @embed */ |
| 11 | + background: url(images/help.png) no-repeat scroll left center transparent; |
| 12 | + padding-left: 20px; |
| 13 | + float: right; |
| 14 | +} |
| 15 | + |
Property changes on: branches/wmf/1.18wmf1/extensions/Translate/resources/ext.translate.helplink.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 16 | + native |
Index: branches/wmf/1.18wmf1/extensions/Translate/resources/images/help.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: branches/wmf/1.18wmf1/extensions/Translate/resources/images/help.png |
___________________________________________________________________ |
Added: svn:mime-type |
2 | 17 | + image/png |