Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php |
— | — | @@ -8,12 +8,15 @@ |
9 | 9 | |
10 | 10 | $dir = dirname( __FILE__ ); |
11 | 11 | $defines = file_get_contents( $dir . '/mediawiki-defines.txt' ); |
12 | | - $sections = array_map( 'trim', preg_split( "/\n\n+/", $defines, -1, PREG_SPLIT_NO_EMPTY ) ); |
13 | 12 | |
| 13 | + $linefeed = '(\r\n|\n)'; |
| 14 | + |
| 15 | + $sections = array_map( 'trim', preg_split( "/$linefeed{2,}/", $defines, -1, PREG_SPLIT_NO_EMPTY ) ); |
| 16 | + |
14 | 17 | $groups = $fixedGroups = array(); |
15 | 18 | |
16 | 19 | foreach ( $sections as $section ) { |
17 | | - $lines = array_map( 'trim', preg_split( "/\n/", $section ) ); |
| 20 | + $lines = array_map( 'trim', preg_split( "/$linefeed/", $section ) ); |
18 | 21 | $newgroup = array(); |
19 | 22 | |
20 | 23 | foreach ( $lines as $line ) { |
Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -11,12 +11,12 @@ |
12 | 12 | class TranslateEditAddons { |
13 | 13 | const MSG = 'translate-edit-'; |
14 | 14 | |
15 | | - static function addNavigation( &$article, &$out ) { |
16 | | - global $wgTranslateMessageNamespaces, $wgUser; |
17 | | - $ns = $article->mTitle->getNamespace(); |
| 15 | + static function addNavigation( &$outputpage, &$text ) { |
| 16 | + global $wgTranslateMessageNamespaces, $wgUser, $wgTitle; |
| 17 | + $ns = $wgTitle->getNamespace(); |
18 | 18 | if( !in_array($ns, $wgTranslateMessageNamespaces) ) return true; |
19 | 19 | |
20 | | - list( $key, $code ) = self::figureMessage( $article ); |
| 20 | + list( $key, $code ) = self::figureMessage( $wgTitle); |
21 | 21 | |
22 | 22 | $group = self::getMessageGroup( $ns, $key ); |
23 | 23 | if ( $group === null ) return true; |
— | — | @@ -62,14 +62,14 @@ |
63 | 63 | wfMsgHtml( 'translate-edit-goto-list' ), |
64 | 64 | "group=$id&language=$code#msg_$next" ); |
65 | 65 | |
66 | | - $out->addHTML( |
| 66 | + $text .= |
67 | 67 | "<hr /> |
68 | 68 | <ul> |
69 | 69 | <li>$prevLink</li> |
70 | 70 | <li>$nextLink</li> |
71 | 71 | <li>$list</li> |
72 | 72 | </ul><hr /> |
73 | | -<pre>$def</pre>" ); |
| 73 | +<pre>$def</pre>"; |
74 | 74 | |
75 | 75 | return true; |
76 | 76 | } |
— | — | @@ -133,9 +133,9 @@ |
134 | 134 | /** |
135 | 135 | * @return Array of the message and the language |
136 | 136 | */ |
137 | | - private static function figureMessage( $object ) { |
| 137 | + private static function figureMessage( $title ) { |
138 | 138 | global $wgContLanguageCode, $wgContLang; |
139 | | - $pieces = explode('/', $wgContLang->lcfirst($object->mTitle->getDBkey()), 3); |
| 139 | + $pieces = explode('/', $wgContLang->lcfirst($title->getDBkey()), 3); |
140 | 140 | |
141 | 141 | $key = $pieces[0]; |
142 | 142 | |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | wfLoadExtensionMessages( 'Translate' ); |
174 | 174 | global $wgTranslateDocumentationLanguageCode, $wgOut; |
175 | 175 | |
176 | | - list( $key, $code ) = self::figureMessage( $object ); |
| 176 | + list( $key, $code ) = self::figureMessage( $object->mTitle ); |
177 | 177 | |
178 | 178 | $group = self::getMessageGroup( $object->mTitle->getNamespace(), $key ); |
179 | 179 | if ( $group === null ) return; |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -define( 'TRANSLATE_VERSION', '9 (2008-07-04:1)' ); |
| 15 | +define( 'TRANSLATE_VERSION', '9 (2008-07-04:2)' ); |
16 | 16 | |
17 | 17 | $wgExtensionCredits['specialpage'][] = array( |
18 | 18 | 'name' => 'Translate', |
— | — | @@ -35,8 +35,7 @@ |
36 | 36 | $wgSpecialPageGroups['TranslationChanges'] = 'changes'; |
37 | 37 | |
38 | 38 | $wgHooks['EditPage::showEditForm:initial'][] = 'TranslateEditAddons::addTools'; |
39 | | -// TODO: Use either a committed hook or commit this |
40 | | -$wgHooks['ArticleAfterView'][] = 'TranslateEditAddons::addNavigation'; |
| 39 | +$wgHooks['OutputPageBeforeHTML'][] = 'TranslateEditAddons::addNavigation'; |
41 | 40 | $wgHooks['UserToggles'][] = 'TranslatePreferences::TranslateUserToggles'; |
42 | 41 | $wgHooks['SpecialRecentChangesQuery'][] = 'TranslateRcFilter::translationFilter'; |
43 | 42 | $wgHooks['SpecialRecentChangesPanel'][] = 'TranslateRcFilter::translationFilterForm'; |
Index: trunk/extensions/Translate/README |
— | — | @@ -34,6 +34,9 @@ |
35 | 35 | |
36 | 36 | == Changes in version 10 == |
37 | 37 | |
| 38 | +* 2008-07-04:2 |
| 39 | + - use a existing hook for quick links |
| 40 | + - possible fix for Windows |
38 | 41 | * 2008-07-04:1 poimport uses correct namespace |
39 | 42 | * 2008-07-01:1 |
40 | 43 | - Fix gettext message name snippets: filter / and trim after trailing |