Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -5,7 +5,8 @@ |
6 | 6 | * Tools for edit page view to aid translators. |
7 | 7 | * |
8 | 8 | * @author Niklas Laxström |
9 | | - * @copyright Copyright © 2007-2008 Niklas Laxström |
| 9 | + * @author Siebrand Mazeland |
| 10 | + * @copyright Copyright © 2007-2009 Niklas Laxström |
10 | 11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
11 | 12 | */ |
12 | 13 | class TranslateEditAddons { |
— | — | @@ -133,7 +134,7 @@ |
134 | 135 | return $fallbacks; |
135 | 136 | } |
136 | 137 | |
137 | | - private static function doBox( $msg, $code, $title = false, $makelink = false ) { |
| 138 | + private static function doBox( $msg, $code, $title = false, $makelink = false, $group = false ) { |
138 | 139 | global $wgUser, $wgLang; |
139 | 140 | if ( $msg === null ) { return ''; } |
140 | 141 | |
— | — | @@ -159,9 +160,17 @@ |
160 | 161 | |
161 | 162 | if( $makelink ) { |
162 | 163 | $skin = $wgUser->getSkin(); |
163 | | - $linkTitle = Title::newFromText( $makelink); |
| 164 | + $linkTitle = Title::newFromText( $makelink ); |
164 | 165 | $title = $skin->makeKnownLinkObj( $linkTitle, $title, 'action=edit' ); |
165 | 166 | } |
| 167 | + |
| 168 | + if( $group && $attributes['class'] == 'mw-sp-translate-edit-definition' ) { |
| 169 | + global $wgLang; |
| 170 | + |
| 171 | + $skin = $wgUser->getSkin(); |
| 172 | + $linkTitle = 'Special:' . SpecialPage::getLocalNameFor( 'Translate' ); |
| 173 | + $title = $skin->makeKnownLinkObj( $linkTitle, $title, 'group=' . $group->getId() . '&language=' . $wgLang ); |
| 174 | + } |
166 | 175 | return TranslateUtils::fieldset( $title, Xml::tags( 'code', null, $msg ), $attributes ); |
167 | 176 | } |
168 | 177 | |
— | — | @@ -287,7 +296,7 @@ |
288 | 297 | // Definition |
289 | 298 | if ( $en !== null ) { |
290 | 299 | $label = " ({$group->getLabel()})"; |
291 | | - $boxes[] = self::doBox( $en, 'en', wfMsg( self::MSG . 'definition' ) . $label ); |
| 300 | + $boxes[] = self::doBox( $en, 'en', wfMsg( self::MSG . 'definition' ) . $label, false, $group ); |
292 | 301 | } |
293 | 302 | |
294 | 303 | |
— | — | @@ -317,6 +326,4 @@ |
318 | 327 | TranslateUtils::injectCSS(); |
319 | 328 | return Xml::tags( 'div', array( 'class' => 'mw-sp-translate-edit-fields' ), implode( "\n\n", $boxes ) ); |
320 | 329 | } |
321 | | - |
322 | | - |
323 | 330 | } |