Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -321,7 +321,7 @@ |
322 | 322 | return $wgTranslateExtensionDirectory; |
323 | 323 | } |
324 | 324 | |
325 | | - public function setDescriptionMsg( $key ) { |
| 325 | + public function setDescriptionMsg( $key, $url ) { |
326 | 326 | global $wgLang; |
327 | 327 | |
328 | 328 | $desc = $this->getMessage( $key, $wgLang->getCode() ); |
— | — | @@ -329,6 +329,9 @@ |
330 | 330 | $desc = $this->getMessage( $key, 'en' ); |
331 | 331 | if ( $desc !== null ) |
332 | 332 | $this->description = $desc; |
| 333 | + |
| 334 | + if ( $url ) |
| 335 | + $this->description .= wfMsgNoTrans( 'translate-ext-url', $url ); |
333 | 336 | } |
334 | 337 | |
335 | 338 | public static function factory( $label, $id ) { |
Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php |
— | — | @@ -6,6 +6,16 @@ |
7 | 7 | public function init() { |
8 | 8 | if ( $this->groups !== null ) return; |
9 | 9 | |
| 10 | + global $wgAutoloadClasses, $IP; |
| 11 | + $wgAutoloadClasses['TxtDef'] = "$IP/extensions/Configure/TxtDef.php"; |
| 12 | + if ( class_exists( 'TxtDef' ) ) { |
| 13 | + $tmp = TxtDef::loadFromFile( "$IP/extensions/Configure/Configure.settings-ext.txt" ); |
| 14 | + $configureData = array_combine( array_map( array( __CLASS__, 'foldId' ), array_keys($tmp)), array_values($tmp) ); |
| 15 | + } else { |
| 16 | + $configureData = array(); |
| 17 | + } |
| 18 | + |
| 19 | + |
10 | 20 | $dir = dirname( __FILE__ ); |
11 | 21 | $defines = file_get_contents( $dir . '/mediawiki-defines.txt' ); |
12 | 22 | |
— | — | @@ -98,10 +108,18 @@ |
99 | 109 | $descmsg = str_replace( 'ext-', '', $id ) . '-desc'; |
100 | 110 | } |
101 | 111 | |
| 112 | + $configureId = self::foldId( $name ); |
| 113 | + if ( isset( $configureData[$configureId]['url'] ) ) { |
| 114 | + $url = $configureData[$configureId]['url']; |
| 115 | + } else { |
| 116 | + $url = false; |
| 117 | + } |
| 118 | + |
102 | 119 | $newgroup = array( |
103 | 120 | 'name' => $name, |
104 | 121 | 'file' => $file, |
105 | 122 | 'descmsg' => $descmsg, |
| 123 | + 'url' => $url, |
106 | 124 | ); |
107 | 125 | |
108 | 126 | $copyvars = array( 'ignored', 'optional', 'var', 'desc', 'prefix', 'mangle' ); |
— | — | @@ -117,6 +135,10 @@ |
118 | 136 | $this->groups = $fixedGroups; |
119 | 137 | } |
120 | 138 | |
| 139 | + static function foldId( $name ) { |
| 140 | + return preg_replace( '/\s+/', '', strtolower( $name ) ); |
| 141 | + } |
| 142 | + |
121 | 143 | public function addAll() { |
122 | 144 | global $wgTranslateAC, $wgTranslateEC; |
123 | 145 | $this->init(); |
— | — | @@ -168,7 +190,7 @@ |
169 | 191 | if ( isset( $info['desc'] ) ) { |
170 | 192 | $group->setDescription( $info['desc'] ); |
171 | 193 | } else { |
172 | | - $group->setDescriptionMsg( $info['descmsg'] ); |
| 194 | + $group->setDescriptionMsg( $info['descmsg'], $info['url'] ); |
173 | 195 | } |
174 | 196 | |
175 | 197 | |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -57,6 +57,7 @@ |
58 | 58 | |
59 | 59 | 'translate-page-description-legend' => 'Information about the group', |
60 | 60 | 'translate-page-edit' => 'edit', |
| 61 | + 'translate-ext-url' => '<hr />Website: $1', |
61 | 62 | |
62 | 63 | 'translate-optional' => '(optional)', |
63 | 64 | 'translate-ignored' => '(ignored)', |