Index: trunk/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: trunk/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: trunk/extensions/Translate/TranslateUtils.php |
— | — | @@ -312,4 +312,17 @@ |
313 | 313 | return $selector; |
314 | 314 | } |
315 | 315 | |
| 316 | + /** |
| 317 | + * @since 2012-01-12 |
| 318 | + */ |
| 319 | + public static function addSpecialHelpLink( OutputPage $out, /*string*/$to ) { |
| 320 | + global $wgExtensionAssetsPath; |
| 321 | + |
| 322 | + $out->addModules( 'ext.translate.helplink' ); |
| 323 | + $text = wfMessage( 'translate-gethelp' )->escaped(); |
| 324 | + $image = Html::element( 'img', array( 'src' => "$wgExtensionAssetsPath/Translate/resources/images/help.png" ) ); |
| 325 | + $link = Html::rawElement( 'a', array( 'href' => "//www.mediawiki.org/wiki/Special:MyLanguage/$to" ), "$image$text" ); |
| 326 | + $wrapper = Html::rawElement( 'div', array( 'class' => 'mw-translate-helplink' ), $link ); |
| 327 | + $out->addHtml( $wrapper ); |
| 328 | + } |
316 | 329 | } |
Index: trunk/extensions/Translate/resources/ext.translate.helplink.css |
— | — | @@ -0,0 +1,19 @@ |
| 2 | +.mw-translate-helplink { |
| 3 | + position: relative; |
| 4 | + margin-top: -10px; |
| 5 | + float: right; |
| 6 | +} |
| 7 | + |
| 8 | +.mw-translate-helplink a { |
| 9 | + display: block; |
| 10 | + position: absolute; |
| 11 | + width: 150px; |
| 12 | + left: -150px; |
| 13 | + text-align: right; |
| 14 | + overflow: hidden; |
| 15 | +} |
| 16 | + |
| 17 | +.mw-translate-helplink img { |
| 18 | + vertical-align: middle; |
| 19 | + margin-right: 4px; |
| 20 | +} |
Property changes on: trunk/extensions/Translate/resources/ext.translate.helplink.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 21 | + native |