Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | 'path' => __FILE__, |
18 | 18 | 'name' => 'Wikimedia Incubator', |
19 | 19 | 'author' => 'SPQRobin', |
20 | | - 'version' => '4.6', |
| 20 | + 'version' => '4.7', |
21 | 21 | 'url' => '//www.mediawiki.org/wiki/Extension:WikimediaIncubator', |
22 | 22 | 'descriptionmsg' => 'wminc-desc', |
23 | 23 | ); |
Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php |
— | — | @@ -540,23 +540,27 @@ |
541 | 541 | } |
542 | 542 | |
543 | 543 | /** |
544 | | - * When creating a new info page, help the user by prefilling it |
| 544 | + * - Redirect action=edit&redlink=1 to the normal page |
| 545 | + * - When creating a new info page, help the user by prefilling it |
545 | 546 | * @return True |
546 | 547 | */ |
547 | 548 | public static function onEditFormPreloadText( &$text, &$title ) { |
548 | 549 | $pagetitle = $title->getText(); |
549 | | - $prefix = IncubatorTest::analyzePrefix( $pagetitle, true /* only info page */ ); |
| 550 | + $prefix = IncubatorTest::analyzePrefix( $pagetitle, true /* only info page */, true /* also sister projects */ ); |
550 | 551 | if( $prefix['error'] || $title->getNamespace() != NS_MAIN ) { |
551 | 552 | return true; |
552 | 553 | } |
553 | | - global $wgRequest, $wgOut; |
| 554 | + global $wgRequest, $wgOut, $wmincSisterProjects; |
554 | 555 | if ( $wgRequest->getBool( 'redlink' ) ) { |
555 | 556 | # The edit page was reached via a red link. |
556 | 557 | # Redirect to the article page and let them click the edit tab if |
557 | 558 | # they really want to create this info page. |
558 | 559 | $wgOut->redirect( $title->getFullUrl() ); |
559 | 560 | } |
560 | | - $text = wfMsgNoTrans( 'wminc-infopage-prefill', $prefix['prefix'] ); |
| 561 | + # Prefill when &action=edit, but not for sister projects |
| 562 | + if( !array_key_exists( $prefix['project'], $wmincSisterProjects ) ) { |
| 563 | + $text = wfMessage( 'wminc-infopage-prefill', $prefix['prefix'] )->plain(); |
| 564 | + } |
561 | 565 | return true; |
562 | 566 | } |
563 | 567 | |
Index: trunk/extensions/WikimediaIncubator/InfoPage.i18n.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | */ |
14 | 14 | $messages['en'] = array( |
15 | 15 | 'wminc-infopage-enter' => 'go to the Main Page', |
16 | | - 'wminc-unknownlang' => '(unknown language with code "$1")', |
| 16 | + 'wminc-unknownlang' => '(unknown language code)', |
17 | 17 | 'wminc-logo-wikipedia' => 'Wikipedia-logo-v2-en.svg', # only translate if necessary |
18 | 18 | 'wminc-logo-wiktionary' => 'Wiktionary-logo-en.svg', # only translate if necessary |
19 | 19 | 'wminc-logo-wikibooks' => 'Wikibooks-logo-en-noslogan.svg', # only translate if necessary |
Index: trunk/extensions/WikimediaIncubator/InfoPage.php |
— | — | @@ -42,9 +42,14 @@ |
43 | 43 | $this->mSubStatus = ''; |
44 | 44 | $this->mThisLangData = array( 'type' => 'valid' ); # For later code check feature |
45 | 45 | $this->mLangNames = IncubatorTest::getLanguageNames(); |
46 | | - $this->mLangName = ( isset( $this->mLangNames[$this->mLangCode] ) ? |
47 | | - $this->mLangNames[$this->mLangCode] : wfMsg( 'wminc-unknownlang', $this->mLangCode ) ); |
48 | | - $this->mFormatTitle = wfMsgHtml( 'wminc-infopage-title-' . $this->mProjectCode, $this->mLangName ); |
| 46 | + $this->mLangName = isset( $this->mLangNames[$this->mLangCode] ) ? |
| 47 | + $this->mLangNames[$this->mLangCode] : null; |
| 48 | + $titleParam = $this->mLangName ? $this->mLangName : '"' . $this->mLangCode . '"'; # Name, else code |
| 49 | + $this->mFormatTitle = wfMessage( 'wminc-infopage-title-' . $this->mProjectCode, $titleParam )->escaped(); |
| 50 | + if( !$this->mLangName ) { |
| 51 | + # Unknown language, add short note to title |
| 52 | + $this->mFormatTitle .= ' ' . wfMessage( 'wminc-unknownlang', $this->mLangCode )->escaped(); |
| 53 | + } |
49 | 54 | return; |
50 | 55 | } |
51 | 56 | |