You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(8) |
Jul
(16) |
Aug
(8) |
Sep
(6) |
Oct
(2) |
Nov
(5) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
|
Feb
(16) |
Mar
(6) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ro...@us...> - 2011-07-24 20:38:43
|
Revision: 28 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=28&view=rev Author: robin-p Date: 2011-07-24 20:38:35 +0000 (Sun, 24 Jul 2011) Log Message: ----------- More updates/merges (other commit(s) following) Modified Paths: -------------- trunk/IncubatorTest.php trunk/SpecialMyMainPage.php trunk/SpecialRandomByTest.php trunk/WikimediaIncubator.i18n.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-07-24 20:36:03 UTC (rev 27) +++ trunk/IncubatorTest.php 2011-07-24 20:38:35 UTC (rev 28) @@ -308,6 +308,22 @@ // ########### START DEVELOPMENT STUFF ############# /** + * This loads language names. Also from CLDR if that extension is found. + * @return Array with language names or empty array + */ + static public function getLanguageNames( $code = '' ) { + if ( is_callable( array( 'LanguageNames', 'getNames' ) ) ) { + global $wgLang; + $langcode = ( $code ? $code : $wgLang->getCode() ); + return LanguageNames::getNames( $langcode, + LanguageNames::FALLBACK_NORMAL, + LanguageNames::LIST_MW_AND_CLDR + ); + } + return Language::getLanguageNames( false ); + } + + /** * Do we know the databases of the existing wikis? * @return Boolean */ @@ -338,6 +354,16 @@ } /** + * @return false or array with closed databases + */ + static function getDBClosedWikis() { + global $wmincClosedWikis; + if( !self::canWeCheckDB() ) { return false; } + return is_array( $wmincClosedWikis ) ? $wmincClosedWikis : + array_map( 'trim', file( $wmincClosedWikis ) ); + } + + /** * @param $prefix Array from IncubatorTest::analyzePrefix(); * @return false or string 'existing' 'closed' 'missing' */ @@ -349,7 +375,7 @@ global $wmincExistingWikis, $wmincClosedWikis; if( !in_array( $db, $wmincExistingWikis ) ) { return 'missing'; # not in the list - } elseif( is_array( $wmincClosedWikis ) && in_array( $db, $wmincClosedWikis ) ) { + } elseif( in_array( $db, self::getDBClosedWikis() ) ) { return 'closed'; # in the list of closed wikis } return 'existing'; Modified: trunk/SpecialMyMainPage.php =================================================================== --- trunk/SpecialMyMainPage.php 2011-07-24 20:36:03 UTC (rev 27) +++ trunk/SpecialMyMainPage.php 2011-07-24 20:38:35 UTC (rev 28) @@ -6,6 +6,7 @@ * * @file * @ingroup SpecialPage + * @author Robin Pepermans (SPQRobin) */ class SpecialMyMainPage extends UnlistedSpecialPage { @@ -14,7 +15,7 @@ parent::__construct( 'MyMainPage' ); } - public function execute() { + public function execute( $par ) { global $wgOut; $title = ''; @@ -24,9 +25,12 @@ global $wgRequest; $title = Title::newFromText( IncubatorTest::displayPrefix() ); if( $wgRequest->getVal( 'goto' ) != 'infopage' ) { - # Used in development version - $params = array( 'goto' => 'mainpage' ); + $params['goto'] = 'mainpage'; } + $url = IncubatorTest::getUrlParam(); + if( $url ) { + $params['testwiki'] = $url['prefix']; + } } # Go to the main page if given invalid title, or if it's not a content project Modified: trunk/SpecialRandomByTest.php =================================================================== --- trunk/SpecialRandomByTest.php 2011-07-24 20:36:03 UTC (rev 27) +++ trunk/SpecialRandomByTest.php 2011-07-24 20:38:35 UTC (rev 28) @@ -13,13 +13,13 @@ global $wgUser, $wgRequest, $wmincPref, $wmincProjectSite; $target = $wgRequest->getVal( 'testwiki' ); $target = IncubatorTest::analyzePrefix( $target ); - $project = ( isset( $target['project'] ) ? $target['project'] : '' ); - $lang = ( isset( $target['lang'] ) ? $target['lang'] : '' ); - if( IncubatorTest::isContentProject() || ($project && $lang) ) { + $project = isset( $target['project'] ) ? $target['project'] : ''; + $lang = isset( $target['lang'] ) ? $target['lang'] : ''; + if( IncubatorTest::isContentProject() || ( $project && $lang ) ) { $dbr = wfGetDB( DB_SLAVE ); $this->extra[] = 'page_title' . $dbr->buildLike( IncubatorTest::displayPrefix( $project, $lang ) . '/', $dbr->anyString() ); - } elseif($wgUser->getOption($wmincPref . '-project') == $wmincProjectSite['short'] ) { + } elseif( $wgUser->getOption($wmincPref . '-project') == $wmincProjectSite['short'] ) { global $wgVersion; # only works above MW 1.17 if( version_compare($wgVersion, '1.17', '>') ) { Modified: trunk/WikimediaIncubator.i18n.php =================================================================== --- trunk/WikimediaIncubator.i18n.php 2011-07-24 20:36:03 UTC (rev 27) +++ trunk/WikimediaIncubator.i18n.php 2011-07-24 20:38:35 UTC (rev 28) @@ -11,29 +11,47 @@ * @author SPQRobin */ $messages['en'] = array( + # General messages 'wminc-desc' => 'Test wiki system for Wikimedia Incubator', - 'wminc-viewuserlang' => 'Look up user language and test wiki', - 'wminc-viewuserlang-user' => 'Username:', - 'wminc-viewuserlang-go' => 'Go', - 'wminc-userdoesnotexist' => 'The user "$1" does not exist.', + 'wminc-manual' => 'Manual', + 'wminc-listwikis' => 'List of wikis', 'wminc-testwiki' => 'Test wiki:', 'wminc-testwiki-none' => 'None/All', + 'wminc-recentchanges-all' => 'All recent changes', + + # Preferences 'wminc-prefinfo-language' => 'Your interface language - independent from your test wiki', 'wminc-prefinfo-code' => 'The ISO 639 language code', 'wminc-prefinfo-project' => 'Select the Wikimedia project (Incubator option is for users who do general work)', 'wminc-prefinfo-error' => 'You selected a project that needs a language code.', + + # Editing/creating pages errors 'wminc-error-move-unprefixed' => "Error: The page you are trying to move to [[{{MediaWiki:Helppage}}|is unprefixed or has a wrong prefix]]!", - 'wminc-error-wronglangcode' => "'''Error:''' The page you are trying to edit contains a [[{{MediaWiki:Helppage}}|wrong language code]] \"$1\"!", - 'wminc-error-unprefixed' => "'''Error:''' The page you are trying to edit is [[{{MediaWiki:Helppage}}|unprefixed]]!", - 'wminc-error-unprefixed-suggest' => "'''Error:''' The page you are trying to edit is [[{{MediaWiki:Helppage}}|unprefixed]]! You can create a page at [[:$1]].", - 'right-viewuserlang' => 'View [[Special:ViewUserLang|user language and test wiki]]', + 'wminc-error-wronglangcode' => "'''Error:''' This page contains a [[{{MediaWiki:Helppage}}|wrong language code]] \"$1\"!", + 'wminc-error-unprefixed' => "'''Error:''' This page is [[{{MediaWiki:Helppage}}|unprefixed]]!", + 'wminc-error-unprefixed-suggest' => "'''Error:''' This page is [[{{MediaWiki:Helppage}}|unprefixed]]! You can create a page at [[:$1]].", + 'wminc-error-wiki-exists' => 'This wiki already exists. You can find this page on $1. If the wiki was recently created, please wait a few hours or days until all content is imported.', + + # Special:RandomByTest 'randombytest' => 'Random page by test wiki', 'randombytest-nopages' => 'There are no pages in your test wiki, in the namespace: $1.', - 'wminc-recentchanges-all' => 'All recent changes', + # Special:ViewUserLang + 'wminc-viewuserlang' => 'Look up user language and test wiki', + 'wminc-viewuserlang-user' => 'Username:', + 'wminc-viewuserlang-go' => 'Go', + 'wminc-userdoesnotexist' => 'The user "$1" does not exist.', + + # User groups + 'right-viewuserlang' => 'View [[Special:ViewUserLang|user language and test wiki]]', 'group-test-sysop' => 'Test wiki administrators', 'group-test-sysop-member' => 'test wiki administrator', 'grouppage-test-sysop' => 'Project:Test wiki administrators', + + # Language codes + 'wminc-code-macrolanguage' => 'The [[wikipedia:$2 language|"$3" language]] is a [[wikipedia:ISO 639 macrolanguage|macrolanguage]], consisting of the following member languages:', + 'wminc-code-collective' => 'The code "$1" does not refer to a specific language, but to a collection of languages, namely the [[wikipedia:$2 language|"$3" languages]].', + 'wminc-code-retired' => 'This language code has been changed and no longer refers to the original language.', ); /** Message documentation (Message documentation) @@ -44,13 +62,8 @@ */ $messages['qqq'] = array( 'wminc-desc' => '{{desc}}', - 'wminc-viewuserlang' => 'Title of a special page to look up the language and test wiki of a user. See [[:File:Incubator-testwiki-viewuserlang.jpg]].', - 'wminc-viewuserlang-user' => 'Label for the input. - -{{Identical|Username}}', - 'wminc-viewuserlang-go' => "Text on the submit button to view the user's language and test wiki. - -{{Identical|Go}}", + 'wminc-manual' => 'As in "handbook".', + 'wminc-listwikis' => 'List of wikis that are in Wikimedia Incubator.', 'wminc-testwiki' => 'See [[:File:Incubator-testwiki-preference.jpg]].', 'wminc-testwiki-none' => "* Used on Special:Preferences when the user didn't select a test wiki preference (yet). * Used on Special:RecentChanges to show normal recent changes display.", @@ -63,7 +76,26 @@ * Do not change <code><nowiki>{{MediaWiki:Helppage}}</nowiki></code>', 'wminc-error-unprefixed-suggest' => '* $1 is a new page title based on the page title the user is currently trying to edit. E.g. "Test" would become "Wx/xx/Test". * Do not change <code><nowiki>{{MediaWiki:Helppage}}</nowiki></code>', + 'wminc-error-wiki-exists' => "'''$1''' is a URL to the existing wiki.", + 'wminc-viewuserlang' => 'Title of a special page to look up the language and test wiki of a user. See [[:File:Incubator-testwiki-viewuserlang.jpg]].', + 'wminc-viewuserlang-user' => 'Label for the input. + +{{Identical|Username}}', + 'wminc-viewuserlang-go' => "Text on the submit button to view the user's language and test wiki. + +{{Identical|Go}}", 'right-viewuserlang' => '{{doc-right|viewuserlang}}', + 'group-test-sysop' => 'Name of the group of administrators of a specific test wiki on the Wikimedia Incubator.', + 'group-test-sysop-member' => 'An administrator of a specific test wiki on the Wikimedia Incubator.', + 'grouppage-test-sysop' => 'Do not change the "Project:" part!', + 'wminc-code-macrolanguage' => "* '''$1''' is the language code (not used by default) +* '''$2''' is the language name in English +* '''$3''' is the translated language name from CLDR, if available (otherwise, English) +It is best '''not''' to change the link to the Wikipedia article about the language. The article about macrolanguage can be changed to point to a translated article.", + 'wminc-code-collective' => "* '''$1''' is the language code +* '''$2''' is the language name in English +* '''$3''' is the translated language namefrom CLDR, if available (otherwise, English) +It is best '''not''' to change the link to the Wikipedia article about the language.", ); /** Adyghe (Cyrillic) () @@ -235,24 +267,33 @@ */ $messages['be-tarask'] = array( 'wminc-desc' => 'Тэставая вікі-сыстэма для інкубатара Фундацыі «Вікімэдыя»', - 'wminc-viewuserlang' => 'Пошук мовы ўдзельніка і тэставай вікі', - 'wminc-viewuserlang-user' => 'Імя ўдзельніка:', - 'wminc-viewuserlang-go' => 'Перайсьці', - 'wminc-userdoesnotexist' => 'Удзельнік «$1» не існуе.', + 'wminc-manual' => 'Інструкцыя', + 'wminc-listwikis' => 'Сьпіс вікі', 'wminc-testwiki' => 'Тэставая вікі:', 'wminc-testwiki-none' => 'Ніякая/усе', + 'wminc-recentchanges-all' => 'Усе апошнія зьмены', 'wminc-prefinfo-language' => 'Вашая мова інтэрфэйсу — незалежная ад мовы Вашай тэставай вікі', 'wminc-prefinfo-code' => 'Код мовы ISO 639', 'wminc-prefinfo-project' => 'Выберыце праект фундацыі «Вікімэдыя» (выберыце варыянт Інкубатар, калі займаецеся агульнай працай)', 'wminc-prefinfo-error' => 'Вы выбралі праект, які патрабуе код мовы.', 'wminc-error-move-unprefixed' => 'Памылка: старонка, якую Вы спрабуеце перанесьці [[{{MediaWiki:Helppage}}|ня мае прэфіксу ці мае няслушны прэфікс]]!', - 'wminc-error-wronglangcode' => "'''Памылка:''' старонка, якую Вы спрабуеце рэдагаваць, утрымлівае [[{{MediaWiki:Helppage}}|няслушны код мовы]] «$1»!", - 'wminc-error-unprefixed' => "'''Памылка:''' старонка, якую Вы спрабуеце рэдагаваць, [[{{MediaWiki:Helppage}}|ня мае прэфіксу]]!", - 'wminc-error-unprefixed-suggest' => "'''Памылка:''' Старонка, якую Вы спрабуеце рэдагаваць, [[{{MediaWiki:Helppage}}|не мае прэфіксу]]! Вы можаце стварыць старонку на [[:$1]].", - 'right-viewuserlang' => 'прагляд [[Special:ViewUserLang|мовы ўдзельніка і тэставаньне вікі]]', + 'wminc-error-wronglangcode' => "'''Памылка:''' гэтая старонка утрымлівае [[{{MediaWiki:Helppage}}|няслушны код мовы]] «$1»!", + 'wminc-error-unprefixed' => "'''Памылка:''' гэтая старонка [[{{MediaWiki:Helppage}}|ня мае прэфіксу]]!", + 'wminc-error-unprefixed-suggest' => "'''Памылка:''' гэтая старонка [[{{MediaWiki:Helppage}}|не мае прэфіксу]]! Вы можаце стварыць старонку на [[:$1]].", + 'wminc-error-wiki-exists' => 'Гэтая вікі ўжо існуе. Вы можаце знайсьці гэтую старонку на $1. Калі вікі была створаная нядаўна, калі ласка, пачакайце некалькі гадзінаў ці дзён, пакуль будзе імпартаваны зьмест.', 'randombytest' => 'Выпадковая старонка тэставай вікі', 'randombytest-nopages' => 'Няма старонак ў Вашай тэставай вікі, у прасторы назваў: $1.', - 'wminc-recentchanges-all' => 'Усе апошнія зьмены', + 'wminc-viewuserlang' => 'Пошук мовы ўдзельніка і тэставай вікі', + 'wminc-viewuserlang-user' => 'Імя ўдзельніка:', + 'wminc-viewuserlang-go' => 'Перайсьці', + 'wminc-userdoesnotexist' => 'Удзельнік «$1» не існуе.', + 'right-viewuserlang' => 'прагляд [[Special:ViewUserLang|мовы ўдзельніка і тэставаньне вікі]]', + 'group-test-sysop' => 'Адміністратары тэставай вікі', + 'group-test-sysop-member' => 'адміністратар тэставай вікі', + 'grouppage-test-sysop' => 'Project:Адміністратары тэставай вікі', + 'wminc-code-macrolanguage' => '[[wikipedia:$2 мова|«$3» мова]] зьяўляецца [[wikipedia:ISO 639 macrolanguage|макрамовай]], якая ўтрымлівае наступную колькасьць моваў:', + 'wminc-code-collective' => 'Код «$1» адносіцца не да пэўнай мовы, а да набору моваў, а менавіта да [[wikipedia:$2 language|«$3»]].', + 'wminc-code-retired' => 'Гэты код мовы быў зьменены і болей не датычыцца арыгінальнай мовы.', ); /** Bulgarian (Български) @@ -300,12 +341,9 @@ */ $messages['br'] = array( 'wminc-desc' => 'Reizhiad testiñ wiki evit Wikimedia Incubator', - 'wminc-viewuserlang' => 'Gwelet yezh an implijer hag e wiki testiñ', - 'wminc-viewuserlang-user' => 'Anv implijer :', - 'wminc-viewuserlang-go' => 'Mont', - 'wminc-userdoesnotexist' => 'N\'eus ket eus an implijer "$1".', 'wminc-testwiki' => 'Wiki testiñ :', 'wminc-testwiki-none' => 'Hini ebet / An holl', + 'wminc-recentchanges-all' => 'An holl gemmoù diwezhañ', 'wminc-prefinfo-language' => "Yezh hoc'h etrefas - distag diouzh hini ho wiki testiñ", 'wminc-prefinfo-code' => 'Kod ISO 639 ar yezh', 'wminc-prefinfo-project' => 'Diuzit ar raktres Wikimedia (miret eo an dibarzh Incubator evit an implijerien a gas da benn ul labour dre vras)', @@ -314,10 +352,13 @@ 'wminc-error-wronglangcode' => "'''Fazi :''' Ur [[{{MediaWiki:Helppage}}|c'hod yezh fall]] \"\$1\" zo d'ar bajenn emaoc'h o klask degas kemmoù enni !", 'wminc-error-unprefixed' => "'''Fazi :''' N'eus [[{{MediaWiki:Helppage}}|rakger ebet]] d'ar bajenn emaoc'h o klask degas kemmoù enni !", 'wminc-error-unprefixed-suggest' => "'''Fazi :''' N'eus [[{{MediaWiki:Helppage}}|rakger ebet]] d'ar bajenn emaoc'h o klask degas kemmoù enni ! Gallout a rit krouiñ ur bajenn war [[:$1]].", - 'right-viewuserlang' => 'Gwelet [[Special:ViewUserLang|yezh an implijer hag ar wiki testiñ]]', 'randombytest' => 'Pajenn dargouezhek gant ar wiki amprouiñ', 'randombytest-nopages' => "N'eus pajenn ebet en ho wiki amprouiñ, en esaouenn anv : $1.", - 'wminc-recentchanges-all' => 'An holl gemmoù diwezhañ', + 'wminc-viewuserlang' => 'Gwelet yezh an implijer hag e wiki testiñ', + 'wminc-viewuserlang-user' => 'Anv implijer :', + 'wminc-viewuserlang-go' => 'Mont', + 'wminc-userdoesnotexist' => 'N\'eus ket eus an implijer "$1".', + 'right-viewuserlang' => 'Gwelet [[Special:ViewUserLang|yezh an implijer hag ar wiki testiñ]]', ); /** Bosnian (Bosanski) @@ -414,24 +455,33 @@ */ $messages['de'] = array( 'wminc-desc' => 'Ermöglicht Testwikis für den Wikimedia Incubator', - 'wminc-viewuserlang' => 'Benutzersprache und Testwiki einsehen', - 'wminc-viewuserlang-user' => 'Benutzername:', - 'wminc-viewuserlang-go' => 'Holen', - 'wminc-userdoesnotexist' => 'Der Benutzer „$1“ ist nicht vorhanden.', + 'wminc-manual' => 'Anleitung', + 'wminc-listwikis' => 'Liste der Wikis', 'wminc-testwiki' => 'Testwiki:', 'wminc-testwiki-none' => 'Keins/Alle', + 'wminc-recentchanges-all' => 'Alle letzten Änderungen', 'wminc-prefinfo-language' => 'Sprache deiner Benutzeroberfläche - vom Testwiki unabhängig', 'wminc-prefinfo-code' => 'Der ISO-639-Sprachcode', 'wminc-prefinfo-project' => 'Das Wikimedia-Projekt, an dem du hier arbeitest („Incubator“ für Benutzer, die allgemeine Aufgaben übernehmen)', 'wminc-prefinfo-error' => 'Bei diesem Projekt muss ein Sprachcode angeben werden!', 'wminc-error-move-unprefixed' => 'Fehler: Die Seite, die du verschieben willst, hat [[{{MediaWiki:Helppage}}|kein oder ein falsches Präfix]].', - 'wminc-error-wronglangcode' => "'''Fehler:''' Die Seite, die du zu bearbeiten versuchst, hat einen [[{{MediaWiki:Helppage}}|falschen Sprachcode]]: \"\$1\".", - 'wminc-error-unprefixed' => "'''Fehler:''' Die Seite, die du zu bearbeiten versuchst, hat [[{{MediaWiki:Helppage}}|kein Präfix]].", - 'wminc-error-unprefixed-suggest' => "'''Fehler:''' Die Seite, die du zu bearbeiten versuchst, hat [[{{MediaWiki:Helppage}}|kein Präfix]]. Du kannst unter [[:$1]] eine Seite anlegen.", - 'right-viewuserlang' => '[[Special:ViewUserLang|Benutzersprache und Testwiki]] anschauen', + 'wminc-error-wronglangcode' => "'''Fehler:''' Diese Seite enthält einen [[{{MediaWiki:Helppage}}|falschen Sprachcode]]: „$1“.", + 'wminc-error-unprefixed' => "'''Fehler:''' Diese Seite hat [[{{MediaWiki:Helppage}}|kein Präfix]].", + 'wminc-error-unprefixed-suggest' => "'''Fehler:''' Diese Seite hat [[{{MediaWiki:Helppage}}|kein Präfix]]. Du kannst unter [[:$1]] eine Seite anlegen.", + 'wminc-error-wiki-exists' => 'Dieses Wiki ist bereits vorhanden. Diese Seite befindet sich auf $1. Sofern das Wiki erst kürzlich erstellt wurde, bitten wir um ein paar Stunden Geduld bis alle Inhalte dorthin übertragen wurden.', 'randombytest' => 'Zufällige Seite aus dem Testwiki', 'randombytest-nopages' => 'Es befinden sich keine Seiten im Namensraum „$1“ deines Testwikis.', - 'wminc-recentchanges-all' => 'Alle letzten Änderungen', + 'wminc-viewuserlang' => 'Benutzersprache und Testwiki einsehen', + 'wminc-viewuserlang-user' => 'Benutzername:', + 'wminc-viewuserlang-go' => 'Holen', + 'wminc-userdoesnotexist' => 'Der Benutzer „$1“ ist nicht vorhanden.', + 'right-viewuserlang' => '[[Special:ViewUserLang|Benutzersprache und Testwiki]] anschauen', + 'group-test-sysop' => 'Testadministratoren', + 'group-test-sysop-member' => 'Testadministrator', + 'grouppage-test-sysop' => 'Project:Testadministratoren', + 'wminc-code-macrolanguage' => 'Die [[wikipedia:$2 language|Sprache „$3“]] ist eine [[wikipedia:de:Makrosprache_(ISO_639)|Makrosprache]], welche die folgenden Einzelsprachen enthält:', + 'wminc-code-collective' => 'Der Code „$1“ bezieht sich nicht auf eine bestimmte Sprache, sondern auf eine Gruppe von Sprachen, namentlich die [[wikipedia:$2 language|Sprachen „$3“]].', + 'wminc-code-retired' => 'Dieser Sprachcode wurde geändert und bezieht sich nicht mehr auf die ursprüngliche Sprache.', ); /** German (formal address) (Deutsch (Sie-Form)) @@ -443,9 +493,7 @@ 'wminc-prefinfo-language' => 'Sprache Ihrer Benutzeroberfläche - vom Testwiki unabhängig', 'wminc-prefinfo-project' => 'Das Wikimedia-Projekt, an dem Sie hier arbeiten („Incubator“ für Benutzer, die allgemeine Aufgaben übernehmen)', 'wminc-error-move-unprefixed' => 'Fehler: Die Seite, die Sie verschieben wollen, hat entweder [[{{MediaWiki:Helppage}}|kein oder ein falsches Präfix]].', - 'wminc-error-wronglangcode' => "'''Fehler:''' Die Seite, die Sie zu bearbeiten versuchen, hat einen [[{{MediaWiki:Helppage}}|falschen Sprachcode]]: \"\$1\".", - 'wminc-error-unprefixed' => "'''Fehler:''' Die Seite, die Sie zu bearbeiten versuchen, hat [[{{MediaWiki:Helppage}}|kein Präfix]].", - 'wminc-error-unprefixed-suggest' => "'''Fehler:''' Die Seite, die Sie zu bearbeiten versuchen, hat [[{{MediaWiki:Helppage}}|kein Präfix]]. Sie können unter [[:$1]] eine Seite anlegen.", + 'wminc-error-unprefixed-suggest' => "'''Fehler:''' Diese Seite hat [[{{MediaWiki:Helppage}}|kein Präfix]]. Sie können unter [[:$1]] eine Seite anlegen.", 'randombytest-nopages' => 'Es befinden sich keine Seiten im Namensraum „$1“ Ihres Testwikis.', ); @@ -610,13 +658,34 @@ * @author Sahim */ $messages['fa'] = array( + 'wminc-desc' => 'سامانهٔ ویکی آزمایشی برای ویکیرشد ویکیمدیا', + 'wminc-manual' => 'راهنمای کاربر', + 'wminc-listwikis' => 'فهرست ویکیها', + 'wminc-testwiki' => 'ویکی آزمایشی:', + 'wminc-testwiki-none' => 'هیچکدام/همه', + 'wminc-recentchanges-all' => 'همه تغییرات اخیر', + 'wminc-prefinfo-language' => 'زبان رابط کاربری شما - مستقل از ویکی آزمایشی شما', + 'wminc-prefinfo-code' => 'کد زبان ایزو ۶۳۹', + 'wminc-prefinfo-project' => 'پروژه ویکیمدیا را انتخاب کنید (گزینه ویکیرشد برای کاربرانی که کار عمومی انجام میدهند)', + 'wminc-prefinfo-error' => 'شما یک پروژهای را انتخاب کردهاید که به یک کد زبان احتیاج دارد.', + 'wminc-error-move-unprefixed' => 'خطا: صفحهای که شما قصد انتقال آن را دارید [[{{MediaWiki:Helppage}}|فاقد پیشوند و یا دارای پیشوند نادرست]] میباشد!', + 'wminc-error-wronglangcode' => "'''خطا:''' این صفحه شامل یک [[{{MediaWiki:Helppage}}|کد زبان نادرست]] میباشد!: «$1»", + 'wminc-error-unprefixed' => "'''خطا:''' این صفحه [[{{MediaWiki:Helppage}}|فاقد پیشوند]] میباشد!", + 'wminc-error-unprefixed-suggest' => "'''خطا:''' این صفحه [[{{MediaWiki:Helppage}}|فاقد پیشوند]] میباشد! شما میتوانید یک صفحه در [[:$1]] ایجاد کنید.", + 'wminc-error-wiki-exists' => 'این ویکی در حال حاضر وجود دارد. شما میتوانید این صفحه را در $1 پیدا کنید. اگر ویکی به تازگی ایجاد شده است، لطفاً چند ساعت یا چند روز صبر کنید تا تمامی محتوا وارد شوند.', + 'randombytest' => 'صفحه تصادفی بر اساس ویکی آزمایشی', + 'randombytest-nopages' => 'هیچ صفحهای در ویکی آزمایشی شما وجود ندارد، در فضای نامی: $1.', + 'wminc-viewuserlang' => 'مشاهده زبان و ویکی آزمایشی کاربر', 'wminc-viewuserlang-user' => 'نام کاربری:', 'wminc-viewuserlang-go' => 'برو', - 'wminc-testwiki' => 'آزمودن ویکی:', - 'wminc-testwiki-none' => 'هیچکدام/همه', - 'wminc-prefinfo-code' => 'کد زبان ایزو ۶۳۹', - 'wminc-warning-suggest-move' => 'شما میتوانید [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} این صفحه را به $1 انتقال دهید].', - 'randombytest' => 'صفحه تصادفی به وسیلهٔ آزمودن ویکی', + 'wminc-userdoesnotexist' => 'کاربر «$1» وجود ندارد.', + 'right-viewuserlang' => 'مشاهده [[Special:ViewUserLang|زبان و ویکی آزمایشی کاربر]]', + 'group-test-sysop' => 'مدیران ویکی آزمایشی', + 'group-test-sysop-member' => 'مدیر ویکی آزمایشی', + 'grouppage-test-sysop' => 'Project:مدیران ویکی آزمایشی', + 'wminc-code-macrolanguage' => '[[wikipedia:$2 language|زبان «$3»]] یک [[wikipedia:ISO 639 macrolanguage|زبان بزرگ]] میباشد، که ترکیبی از زبانهای مقابل میباشد:', + 'wminc-code-collective' => 'کد "$1" به زبان خاصی ارجاع نمیدهد، ولی به مجموعهای از زبانها ارجاع میدهد، یعنی [[wikipedia:$2 language|زبانهای «$3»]].', + 'wminc-code-retired' => 'کد زبان تغییر کرده است و دیگر به زبان اصلی ارجاع نمیدهد.', ); /** Finnish (Suomi) @@ -649,29 +718,36 @@ * @author Crochet.david * @author IAlex * @author PieRRoMaN + * @author Seb35 * @author Sylvain2803 * @author Urhixidur */ $messages['fr'] = array( 'wminc-desc' => 'Système de test de wiki pour Wikimedia Incubator', - 'wminc-viewuserlang' => 'Voir la langue de l’utilisateur et son wiki de test', - 'wminc-viewuserlang-user' => 'Nom d’utilisateur :', - 'wminc-viewuserlang-go' => 'Aller', - 'wminc-userdoesnotexist' => "L'utilisateur « $1 » n'existe pas.", + 'wminc-manual' => 'Manuel', + 'wminc-listwikis' => 'Liste des wikis', 'wminc-testwiki' => 'Wiki de test :', 'wminc-testwiki-none' => 'Aucun / tous', + 'wminc-recentchanges-all' => 'Toutes les modifications récentes', 'wminc-prefinfo-language' => 'Votre langue d’interface - indépendante de celle de votre wiki de test', 'wminc-prefinfo-code' => 'Le code ISO 639 de la langue', 'wminc-prefinfo-project' => 'Sélectionnez le projet Wikimedia (l’option Incubator est destinée aux utilisateurs qui font un travail général)', 'wminc-prefinfo-error' => 'Vous avez sélectionné un projet qui nécessite un code de langue.', 'wminc-error-move-unprefixed' => "Erreur : La page vers laquelle vous tentez de renommer [[{{MediaWiki:Helppage}}|n'a pas de préfixe ou a un préfixe erroné]] !", - 'wminc-error-wronglangcode' => "'''Erreur:''' la page que vous essayez d'éditer contient un [[{{MediaWiki:Helppage}}|code de langue erroné]] \"\$1\" !", - 'wminc-error-unprefixed' => "''' Erreur:''' la page que vous essayez d'éditer n'a [[{{MediaWiki:Helppage}}|pas de préfixe]] !", - 'wminc-error-unprefixed-suggest' => "''' Erreur:''' la page que vous essayez d'éditer n'a [[{{MediaWiki:Helppage}}|pas de préfixe]] ! Vous pouvez créer la page suivante : [[:$1]].", - 'right-viewuserlang' => 'Voir [[Special:ViewUserLang|la langue de l’utilisateur et le wiki de test]]', + 'wminc-error-wronglangcode' => "'''Erreur :''' cette page contient un [[{{MediaWiki:Helppage}}|code de langue erroné]] \"\$1\" !", + 'wminc-error-unprefixed' => "'''Erreur :''' cette page n’a [[{{MediaWiki:Helppage}}|pas de préfixe]] !", + 'wminc-error-unprefixed-suggest' => "'''Erreur :''' cette page n’a [[{{MediaWiki:Helppage}}|pas de préfixe]] ! Vous pouvez créer une page sur : [[:$1]].", + 'wminc-error-wiki-exists' => 'Ce wiki existe déjà. Vous pouvez trouver cette page sur $1. Si le wiki a été récemment créé, veuillez attendre quelques heures ou jours afin que tout le contenu soit importé.', 'randombytest' => 'Page aléatoire par le wiki de test', 'randombytest-nopages' => 'Votre wiki de test ne contient pas de page dans l’espace de noms : $1.', - 'wminc-recentchanges-all' => 'Toutes les modifications récentes', + 'wminc-viewuserlang' => 'Voir la langue de l’utilisateur et son wiki de test', + 'wminc-viewuserlang-user' => 'Nom d’utilisateur :', + 'wminc-viewuserlang-go' => 'Aller', + 'wminc-userdoesnotexist' => "L'utilisateur « $1 » n'existe pas.", + 'right-viewuserlang' => 'Voir [[Special:ViewUserLang|la langue de l’utilisateur et le wiki de test]]', + 'wminc-code-macrolanguage' => 'La [[wikipedia:fr:$3|langue « $3 »]] est une [[wikipedia:fr:macro-langue|macro-langue]], comprenant les langues suivantes :', + 'wminc-code-collective' => 'Le code « $1 » ne se réfère pas à une langue spécifique, mais à une collection de langues, en particulier les [[wikipedia:fr:$3|langues « $3 »]]', + 'wminc-code-retired' => 'Ce code de langue a été changé est ne fait plus référence à la langue d’origine.', ); /** Franco-Provençal (Arpetan) @@ -680,19 +756,22 @@ */ $messages['frp'] = array( 'wminc-desc' => 'Sistèmo de vouiqui d’èprôva por Wikimedia Covosa.', - 'wminc-viewuserlang' => 'Vêre la lengoua a l’utilisator et lo vouiqui d’èprôva', - 'wminc-viewuserlang-user' => 'Nom d’utilisator :', - 'wminc-viewuserlang-go' => 'Alar trovar', - 'wminc-userdoesnotexist' => 'L’utilisator « $1 » ègziste pas.', + 'wminc-manual' => 'Manuâl', + 'wminc-listwikis' => 'Lista des vouiquis', 'wminc-testwiki' => 'Vouiqui d’èprôva :', 'wminc-testwiki-none' => 'Nion / tôs', + 'wminc-recentchanges-all' => 'Tôs los dèrriérs changements', 'wminc-prefinfo-language' => 'Voutra lengoua d’entèrface - endèpendenta de cela de voutron vouiqui d’èprôva', 'wminc-prefinfo-code' => 'Lo code ISO 639 de la lengoua', 'wminc-prefinfo-project' => 'Chouèsésséd lo projèt Wikimedia (lo chouèx Covosa est dèstinâ ux utilisators que font un travâly g·ènèral)', 'wminc-prefinfo-error' => 'Vos éd chouèsi un projèt qu’at fôta d’un code lengoua.', - 'right-viewuserlang' => 'Vêre la [[Special:ViewUserLang|lengoua a l’utilisator et lo vouiqui d’èprôva]]', 'randombytest' => 'Pâge a l’hasârd per lo vouiqui d’èprôva', 'randombytest-nopages' => 'Voutron vouiqui d’èprôva contint gins de pâge dens l’èspâço de noms : $1.', + 'wminc-viewuserlang' => 'Vêre la lengoua a l’utilisator et lo vouiqui d’èprôva', + 'wminc-viewuserlang-user' => 'Nom d’utilisator :', + 'wminc-viewuserlang-go' => 'Alar trovar', + 'wminc-userdoesnotexist' => 'L’utilisator « $1 » ègziste pas.', + 'right-viewuserlang' => 'Vêre la [[Special:ViewUserLang|lengoua a l’utilisator et lo vouiqui d’èprôva]]', ); /** Galician (Galego) @@ -700,12 +779,9 @@ */ $messages['gl'] = array( 'wminc-desc' => 'Sistema wiki de probas para a Incubadora da Wikimedia', - 'wminc-viewuserlang' => 'Olle a lingua de usuario e o wiki de proba', - 'wminc-viewuserlang-user' => 'Nome de usuario:', - 'wminc-viewuserlang-go' => 'Ir', - 'wminc-userdoesnotexist' => 'O usuario "$1" non existe.', 'wminc-testwiki' => 'Wiki de proba:', 'wminc-testwiki-none' => 'Ningún/Todos', + 'wminc-recentchanges-all' => 'Todos os cambios recentes', 'wminc-prefinfo-language' => 'A súa lingua da interface (independente do seu wiki de proba)', 'wminc-prefinfo-code' => 'O código de lingua ISO 639', 'wminc-prefinfo-project' => 'Seleccione o proxecto Wikimedia (a opción da Incubadora é para os usuarios que fan traballo xeral)', @@ -714,10 +790,13 @@ 'wminc-error-wronglangcode' => "'''Erro:''' A páxina que intenta editar contén un [[{{MediaWiki:Helppage}}|código de lingua incorrecto]] (\"\$1\")!", 'wminc-error-unprefixed' => "'''Erro:''' A páxina que intenta editar non ten [[{{MediaWiki:Helppage}}|prefixo]]!", 'wminc-error-unprefixed-suggest' => "'''Erro:''' A páxina que intenta editar non ten [[{{MediaWiki:Helppage}}|prefixo]]! Pode crear unha páxina en \"[[:\$1]]\".", - 'right-viewuserlang' => 'Ver [[Special:ViewUserLang|a lingua do usuario e o wiki de probas]]', 'randombytest' => 'Páxina ao chou para o wiki de proba', 'randombytest-nopages' => 'O seu wiki de proba aínda non ten páxinas no espazo de nomes: $1.', - 'wminc-recentchanges-all' => 'Todos os cambios recentes', + 'wminc-viewuserlang' => 'Olle a lingua de usuario e o wiki de proba', + 'wminc-viewuserlang-user' => 'Nome de usuario:', + 'wminc-viewuserlang-go' => 'Ir', + 'wminc-userdoesnotexist' => 'O usuario "$1" non existe.', + 'right-viewuserlang' => 'Ver [[Special:ViewUserLang|a lingua do usuario e o wiki de probas]]', ); /** Ancient Greek (Ἀρχαία ἑλληνικὴ) @@ -779,24 +858,33 @@ */ $messages['he'] = array( 'wminc-desc' => 'מערכת אתרי ויקי ניסיוניים עבור האינקובטור של ויקימדיה', - 'wminc-viewuserlang' => 'חיפוש שפת משתמש ואתר ויקי ניסיוני', - 'wminc-viewuserlang-user' => 'שם המשתמש:', - 'wminc-viewuserlang-go' => 'הצגה', - 'wminc-userdoesnotexist' => 'המשתמש "$1" אינו קיים.', + 'wminc-manual' => 'ספר הוראות', + 'wminc-listwikis' => 'רשימת אתרי ויקי', 'wminc-testwiki' => 'אתר ויקי ניסיוני:', 'wminc-testwiki-none' => 'הכול/לא כלום', + 'wminc-recentchanges-all' => 'כל השינויים האחרונים', 'wminc-prefinfo-language' => 'שפת הממשק שלכם – בלתי תלויה באתר הוויקי הניסיוני שלכם', 'wminc-prefinfo-code' => 'קוד השפה לפי ISO 639', 'wminc-prefinfo-project' => 'בחרו אחד ממיזמי ויקימדיה (האפשרות "אינקובטור" מיועדת למשתמשים המבצעים עבודה כללית)', 'wminc-prefinfo-error' => 'בחרתם במיזם הדורש קוד שפה.', 'wminc-error-move-unprefixed' => 'שגיאה: הדף שאתם מנסים להעביר אליו [[{{MediaWiki:Helppage}}|אינו בעל תחילית או שהוא בעלת תחילית שאינה נכונה]]!', - 'wminc-error-wronglangcode' => "'''שגיאה:''' הדף שאתם מנסים לערוך מכיל [[{{MediaWiki:Helppage}}|קוד שפה שגוי]] – \"\$1\"!", - 'wminc-error-unprefixed' => 'שגיאה: הדף שאתם מנסים להעביר אליו [[{{MediaWiki:Helppage}}|אינו בעל תחילית]]!', - 'wminc-error-unprefixed-suggest' => 'שגיאה: הדף שאתם מנסים להעביר אליו [[{{MediaWiki:Helppage}}|אינו בעל תחילית]]! אפשר ליצור דף ב־[[:$1]].', - 'right-viewuserlang' => 'צפייה ב[[Special:ViewUserLang|שפת המשתמש ואתר הוויקי הניסיוני]]', + 'wminc-error-wronglangcode' => "'''שגיאה:''' הדף הזה מכיל את [[{{MediaWiki:Helppage}}|קוד השפה השגוי]] \"\$1\"!", + 'wminc-error-unprefixed' => 'שגיאה: לדף הזה [[{{MediaWiki:Helppage}}|אין תחילית]]!', + 'wminc-error-unprefixed-suggest' => 'שגיאה: לדף הזה [[{{MediaWiki:Helppage}}|אין תחילית]]! אפשר ליצור דף בשם [[:$1]].', + 'wminc-error-wiki-exists' => 'הוויקי הזה כבר קיים. אפשר למצוא את הדף הזה בשם $1. אם הוויקי נוצר לאחרונה, נא לחכות מספר שעות או ימים עד שכל התוכן ייובא.', 'randombytest' => 'דף אקראי באתר ויקי ניסיוני', 'randombytest-nopages' => 'אין דפים באתר הוויקי הניסיוני שלכם, במרחב השם: $1.', - 'wminc-recentchanges-all' => 'כל השינויים האחרונים', + 'wminc-viewuserlang' => 'חיפוש שפת משתמש ואתר ויקי ניסיוני', + 'wminc-viewuserlang-user' => 'שם המשתמש:', + 'wminc-viewuserlang-go' => 'הצגה', + 'wminc-userdoesnotexist' => 'המשתמש "$1" אינו קיים.', + 'right-viewuserlang' => 'צפייה ב[[Special:ViewUserLang|שפת המשתמש ואתר הוויקי הניסיוני]]', + 'group-test-sysop' => 'מפעילי ויקי לבדיקה', + 'group-test-sysop-member' => 'מפעיל ויקי לבדיקה', + 'grouppage-test-sysop' => 'Project:מפעילי ויקי לבדיקה', + 'wminc-code-macrolanguage' => '[[wikipedia:$2 language|השפה "$3"]] היא [[wikipedia:ISO 639 macrolanguage|מקרו־שפה]], שמורכבת מהשפות הבאות:', + 'wminc-code-collective' => 'הקוד "$1" לא מתייחס לשפה מסוימת, אלא לאוסף שפות, [[wikipedia:$2 language|"$3"]].', + 'wminc-code-retired' => 'קוד השפה הזה השתנה וכבר אינו מתייחס לשפה המקורית.', ); /** Hiligaynon (Ilonggo) @@ -870,24 +958,23 @@ /** Hungarian (Magyar) * @author Bdamokos * @author Glanthor Reviol + * @author Xbspiro */ $messages['hu'] = array( 'wminc-desc' => 'Tesztwiki rendszer a Wikimédia Inkubátorhoz', - 'wminc-viewuserlang' => 'Felhasználó nyelvének és a tesztwikinek a felkeresése', - 'wminc-viewuserlang-user' => 'Felhasználói név:', - 'wminc-viewuserlang-go' => 'Menj', 'wminc-testwiki' => 'Tesztwiki:', 'wminc-testwiki-none' => 'Egyik sem/Mind', + 'wminc-recentchanges-all' => 'Minden friss változtatás', 'wminc-prefinfo-language' => 'A felhasználói felületed nyelve – független a teszt wikidtől', - 'wminc-prefinfo-code' => 'Az ISO 639 szerinti nyelvkód', - 'wminc-prefinfo-project' => 'Válaszd ki a Wikimédia projektet (az inkubátor választási lehetőség azoknak a felhasználóknak szól, akik általános munkát végeznek)', + 'wminc-prefinfo-code' => 'Az ISO 639 szerinti nyelvkód. A fenti beállítás kiegészítése: a kettő együtt határozza meg, hogy melyik lesz az elsődleges tesztprojekted.', + 'wminc-prefinfo-project' => 'Melyik tesztprojektben dolgozol elsődlegesen? Ennek kezdőlapja és friss változtatásainak listája az oldalmenüben külön is elérhető lesz.', 'wminc-prefinfo-error' => 'Olyan projektet választottál, amihez szükség van nyelvkódra.', - 'wminc-warning-unprefixed' => "'''Figyelmeztetés:''' nincs előtagja a lapnak, amit szerkesztesz!", - 'wminc-warning-suggest' => 'Létrehozhatsz lapot a(z) [[:$1]] címen.', - 'wminc-warning-suggest-move' => '[{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} Átnevezheted a lapot erre: $1].', - 'right-viewuserlang' => '[[Special:ViewUserLang|felhasználó nyelv és teszt wiki]] megjelenítése', 'randombytest' => 'Véletlen lap a tesztwikiből', 'randombytest-nopages' => 'Nincsenek lapok a teszt wikid $1 névterében.', + 'wminc-viewuserlang' => 'Felhasználó nyelvének és a tesztwikinek a felkeresése', + 'wminc-viewuserlang-user' => 'Felhasználói név:', + 'wminc-viewuserlang-go' => 'Menj', + 'right-viewuserlang' => '[[Special:ViewUserLang|felhasználó nyelv és teszt wiki]] megjelenítése', ); /** Interlingua (Interlingua) @@ -895,24 +982,33 @@ */ $messages['ia'] = array( 'wminc-desc' => 'Systema pro wikis de test in Wikimedia Incubator', - 'wminc-viewuserlang' => 'Vider le lingua de un usator e su wiki de test', - 'wminc-viewuserlang-user' => 'Nomine de usator:', - 'wminc-viewuserlang-go' => 'Ir', - 'wminc-userdoesnotexist' => 'Le usator "$1" non existe.', + 'wminc-manual' => 'Manual', + 'wminc-listwikis' => 'Lista de wikis', 'wminc-testwiki' => 'Wiki de test:', 'wminc-testwiki-none' => 'Nulle/Totes', + 'wminc-recentchanges-all' => 'Tote le modificationes recente', 'wminc-prefinfo-language' => 'Le lingua de tu interfacie - independente de tu wiki de test', 'wminc-prefinfo-code' => 'Le codice ISO 639 del lingua', 'wminc-prefinfo-project' => 'Selige le projecto Wikimedia (le option Incubator es pro usatores qui face labor general)', 'wminc-prefinfo-error' => 'Tu seligeva un projecto que require un codice de lingua.', 'wminc-error-move-unprefixed' => 'Error: Le nove nomine de pagina [[{{MediaWiki:Helppage}}|non ha prefixo o ha un prefixo incorrecte]]!', - 'wminc-error-wronglangcode' => "'''Error:''' Le pagina que tu tenta modificar contine un [[{{MediaWiki:Helppage}}|codice de lingua incorrecte]] \"\$1\"!", - 'wminc-error-unprefixed' => "'''Error:''' Le pagina que tu tenta modificar [[{{MediaWiki:Helppage}}|non ha prefixo]]!", - 'wminc-error-unprefixed-suggest' => "'''Error:''' Le pagina que tu tenta modificar [[{{MediaWiki:Helppage}}|non ha prefixo]]! Tu pote crear un pagina con le nomine [[:$1]].", - 'right-viewuserlang' => 'Vider le [[Special:ViewUserLang|lingua e wiki de test de usatores]]', + 'wminc-error-wronglangcode' => "'''Error:''' Iste pagina contine un [[{{MediaWiki:Helppage}}|codice de lingua incorrecte]] \"\$1\"!", + 'wminc-error-unprefixed' => "'''Error:''' Iste pagina [[{{MediaWiki:Helppage}}|non ha prefixo]]!", + 'wminc-error-unprefixed-suggest' => "'''Error:''' Iste pagina [[{{MediaWiki:Helppage}}|non ha prefixo]]! Tu pote crear un pagina con le nomine [[:$1]].", + 'wminc-error-wiki-exists' => 'Iste wiki jam existe. Tu pote trovar iste pagina a $1. Si le wiki esseva create recentemente, per favor attende alcun horas o dies usque tote le contento ha essite importate.', 'randombytest' => 'Pagina aleatori per le wiki de test', 'randombytest-nopages' => 'Le wiki de test non ha paginas in le spatio de nomines: $1', - 'wminc-recentchanges-all' => 'Tote le modificationes recente', + 'wminc-viewuserlang' => 'Vider le lingua de un usator e su wiki de test', + 'wminc-viewuserlang-user' => 'Nomine de usator:', + 'wminc-viewuserlang-go' => 'Ir', + 'wminc-userdoesnotexist' => 'Le usator "$1" non existe.', + 'right-viewuserlang' => 'Vider le [[Special:ViewUserLang|lingua e wiki de test de usatores]]', + 'group-test-sysop' => 'Administratores del wiki de test', + 'group-test-sysop-member' => 'administrator del wiki de test', + 'grouppage-test-sysop' => 'Project:Administratores del wiki de test', + 'wminc-code-macrolanguage' => 'Le [[wikipedia:$2 language|lingua "$3"]] es un [[wikipedia:ISO 639 macrolanguage|macrolingua]] que se compone del sequente linguas membros:', + 'wminc-code-collective' => 'Le codice "$1" non refere a un lingua specific, ma a un collection de linguas, a saper le [[wikipedia:$2 language|linguas "$3"]].', + 'wminc-code-retired' => 'Iste codice de lingua ha essite cambiate e non plus refere al lingua original.', ); /** Indonesian (Bahasa Indonesia) @@ -962,23 +1058,27 @@ */ $messages['it'] = array( 'wminc-desc' => 'Sistema wiki di test per Wikimedia Incubator', - 'wminc-viewuserlang' => 'Ricerca della lingua utente e del wiki di test', - 'wminc-viewuserlang-user' => 'Nome utente:', - 'wminc-viewuserlang-go' => 'Vai', - 'wminc-userdoesnotexist' => 'L\'utente "$1" non esiste.', + 'wminc-listwikis' => 'Elenco di wiki', 'wminc-testwiki' => 'Test wiki:', 'wminc-testwiki-none' => 'Nessuno/Tutti', + 'wminc-recentchanges-all' => 'Tutte le modifiche recenti', 'wminc-prefinfo-language' => "La lingua dell'interfaccia - indipendente dal tuo wiki di test", 'wminc-prefinfo-code' => 'Il codice ISO 639 per la lingua', 'wminc-prefinfo-project' => "Seleziona il progetto Wikimedia (l'opzione Incubator è per gli utentu che fanno del lavoro generale)", 'wminc-prefinfo-error' => 'Hai selezionato un progetto che ha bisogno di un codice di linguaggio', 'wminc-error-move-unprefixed' => 'Errore: La pagina che stai cercando di spostare a [[{{MediaWiki:Helppage}}|è senza prefisso o ha un prefisso sbagliato]]!', - 'wminc-error-wronglangcode' => "'''Errore:''' La pagina che stai cercando di modificare contiene un [[{{MediaWiki:Helppage}}|codice lingua errato]] \"\$1\"!", - 'wminc-error-unprefixed' => "'''Errore:''' La pagina che stai cercando di modificare è [[{{MediaWiki:Helppage}}|senza prefisso]]!", - 'right-viewuserlang' => 'Visualizza [[Special:ViewUserLang|il linguaggio utente e prova il wiki]]', + 'wminc-error-wronglangcode' => "'''Errore:''' Questa pagina contiene un [[{{MediaWiki:Helppage}}|codice lingua errato]] \"\$1\"!", + 'wminc-error-unprefixed' => "'''Errore:''' Questa pagina è [[{{MediaWiki:Helppage}}|senza prefisso]]!", + 'wminc-error-unprefixed-suggest' => "'''Errore:''' Questa pagina è [[{{MediaWiki:Helppage}}|senza prefisso]]! Puoi creare la pagina [[:$1]].", 'randombytest' => 'Una pagina a caso dalla wiki di test', 'randombytest-nopages' => 'Non ci sono pagine nella tua wiki di test, per il namespace: $1.', - 'wminc-recentchanges-all' => 'Tutte le modifiche recenti', + 'wminc-viewuserlang' => 'Ricerca della lingua utente e del wiki di test', + 'wminc-viewuserlang-user' => 'Nome utente:', + 'wminc-viewuserlang-go' => 'Vai', + 'wminc-userdoesnotexist' => 'L\'utente "$1" non esiste.', + 'right-viewuserlang' => 'Visualizza [[Special:ViewUserLang|il linguaggio utente e prova il wiki]]', + 'wminc-code-macrolanguage' => 'La [[wikipedia:$2 language|lingua "$3"]] è una [[wikipedia:ISO 639 macrolanguage|macrolingua]], composta dalle seguenti lingue:', + 'wminc-code-retired' => 'Questo codice lingua è stato modificato e non si riferisce più alla lingua originale.', ); /** Japanese (日本語) @@ -1079,23 +1179,34 @@ * @author Purodha */ $messages['ksh'] = array( - 'wminc-desc' => 'Täß-Wiki Süßtemm för dä Inkubator vun de Wikimedia Shtefftung', - 'wminc-viewuserlang' => 'Däm Metmaacher sing Shprooch un sing Täß-Wiki aanloore', - 'wminc-viewuserlang-user' => 'Metmaacher Name:', + 'wminc-desc' => 'Süßtemm för Versöhkß-Wikis för dä Inkubator vun de Wikimedia Shtefftung', + 'wminc-manual' => 'Handbooch', + 'wminc-listwikis' => 'Leß met de Wikis', + 'wminc-testwiki' => 'Et Versöhkß-Wiki:', + 'wminc-testwiki-none' => 'Kein/All', + 'wminc-recentchanges-all' => 'All de {{LCFIRST:{{int:recentchanges}}}}', + 'wminc-prefinfo-language' => 'Ding Shprooch för däm Wiki sing Bovverfläsch un et Wiki ze bedeene — hät nix met Dingem Versöhkß-Wiki singe Shprooch ze donn', + 'wminc-prefinfo-code' => 'Dat Köözel för di Shprooch noh dä Norrem ISO 639', + 'wminc-prefinfo-project' => 'Donn dat Projäk ußwähle — „Incubator“ is för Lück met alljemein Werk.', + 'wminc-prefinfo-error' => 'Bei dämm Projäk moß och e Köözel för de Shprooch aanjejovve wääde.', + 'wminc-error-move-unprefixed' => 'Dat es jeiht nit: Dä neue Name för di Sigg hät [[{{MediaWiki:Helppage}}|kei udder e verkeeht Köözel]] am Aanfang!', + 'wminc-error-wronglangcode' => "'''Dat es jeiht nit:''' Di Sigg häd [[{{MediaWiki:Helppage}}|e verkeeht Köözel för de Shprooch]], dat es: „$1“", + 'wminc-error-unprefixed' => "'''Dat es jeiht nit:''' Di Sigg hät kei [[{{MediaWiki:Helppage}}|Köözel am Aanfang]]!", + 'wminc-error-unprefixed-suggest' => "'''Dat es jeiht nit:''' Di Sigg hät kei [[{{MediaWiki:Helppage}}|Köözel am Aanfang]]! Do kanns en Sigg onger [[:$1]] aanlääje.", + 'wminc-error-wiki-exists' => 'Dat Wiki jidd_et ald. Do kanns di Sigg op $1 fenge. Wann dat Wiki jraad neu opjemaat woode sin sullt, donn e paa Shtonde udder a paa Dääsch waade, bes dat alle Sigg von heh noh doh erövver jehollt woode sen.', + 'randombytest' => 'En zohfällije Sigg uss_em Versöhkß-Wiki', + 'randombytest-nopages' => 'En Appachtemang $1 sin kein Sigge uß Dingem Versöhkß-Wiki.', + 'wminc-viewuserlang' => 'Däm Metmaacher sing Shprooch un sing Versöhkß-Wiki aanloore', + 'wminc-viewuserlang-user' => 'Däm Metmaacher singe Name:', 'wminc-viewuserlang-go' => 'Lohß Jonn!', 'wminc-userdoesnotexist' => 'Ene Metmaacher „$1“ jidd_et nit.', - 'wminc-testwiki' => 'Täß-Wiki:', - 'wminc-testwiki-none' => 'Kein/All', - 'wminc-prefinfo-language' => 'De Shprooch för däm Wiki sing Bovverfläsch un et Wiki ze Bedeene — hät nix met Dingem Täß-Wiki singe Shprooch ze donn', - 'wminc-prefinfo-code' => 'Dat Köözel för de Shprooch noh dä Norrem ISO 639', - 'wminc-prefinfo-project' => 'Donn dat Projak ußwähle — „Incubator“ is för Lück met alljemein Werk.', - 'wminc-prefinfo-error' => 'Bei dämm Projäk moß och en Köözel för de Shprooch aanjejovve wääde.', - 'wminc-warning-unprefixed' => 'Opjepaß: Do bes en Sigg oohne ene Namess-Försatz för et Projäk un en Shprooch am beärbeide!', - 'wminc-warning-suggest' => 'De kanns en Sigg aanlääje als [[:$1]].', - 'wminc-warning-suggest-move' => 'Do kanns hee di Sigg [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} op $1 ömnänne].', - 'right-viewuserlang' => 'De [[Special:ViewUserLang|Metmaacher ier Shprooche un Täßwiki]] beloore', - 'randombytest' => 'Zofällije Sigg uss_em Versoochswiki', - 'randombytest-nopages' => 'Et Appachtemang $1 änthält kein Sigge en Dingem Versöhkß-Wiki.', + 'right-viewuserlang' => 'De [[Special:ViewUserLang|Metmaacher ier Shprooch un Versöhkß-Wiki]] beloore', + 'group-test-sysop' => 'Köbeße för e Versöhkß-Wiki', + 'group-test-sysop-member' => 'Köbes för e Versöhkß-Wiki', + 'grouppage-test-sysop' => 'Project:Köbeße för Versöhkß-Wikis', + 'wminc-code-macrolanguage' => 'De Sprooch „[[wikipedia:$2 language|$3]]“ is en [[wikipedia:ksh:Makroshprooch (ISO 639-3)|Makroshprooch noh ISO 639-3]], woh heh di Shprooche bei jehüre:', + 'wminc-code-collective' => 'Dat Köözel „$1“ es nit för en bestemmpte Shprooch, söndern för en Sammlong vun Shprooche, nämmlesch de [[wikipedia:$2 language|$3 Shprooche]].', + 'wminc-code-retired' => 'Dat Köözel fö di Shprooch wood jeändert un deiht nit mieh för di Shprooch.', ); /** Kurdish (Latin) (Kurdî (Latin)) @@ -1124,20 +1235,22 @@ */ $messages['lb'] = array( 'wminc-desc' => 'Testwiki-System fir de Wikimedia-Incubator', - 'wminc-viewuserlang' => 'Benotzersprooch an Test-Wiki nokucken', - 'wminc-viewuserlang-user' => 'Benotzernumm:', - 'wminc-viewuserlang-go' => 'Lass', - 'wminc-userdoesnotexist' => "De Benotzer ''$1'' gëtt et net.", + 'wminc-listwikis' => 'Lëscht vun de Wikien', 'wminc-testwiki' => 'Test-Wiki:', 'wminc-testwiki-none' => 'Keen/All', + 'wminc-recentchanges-all' => 'All rezent Ännerungen', 'wminc-prefinfo-language' => 'Sprooch vun ärem Interface - onofhängeg vun Ärer Test-Wiki', 'wminc-prefinfo-code' => 'Den ISO 639 Sprooche-Code', 'wminc-prefinfo-project' => "Wielt de Wikimediaprojet (D'Optioun 'Incubator' ass fir Benotzer déi allgemeng Aufgaben erledigen)", 'wminc-prefinfo-error' => 'Dir hutt e Projet gewielt deen e Sproochecode brauch.', - 'right-viewuserlang' => '[[Special:ViewUserLang|Benotzersprooch an Test-Wiki]] weisen', + 'wminc-error-wronglangcode' => "'''Feeler:''' Op dëser Säit ass e [[{{MediaWiki:Helppage}}|falsche Sproochecode]] \"\$1\"!", 'randombytest' => 'Zoufallssäit duerch Test Wiki', 'randombytest-nopages' => 'Et si keng Säiten op Ärer Test-Wiki, am Nummraum: $1.', - 'wminc-recentchanges-all' => 'All rezent Ännerungen', + 'wminc-viewuserlang' => 'Benotzersprooch an Test-Wiki nokucken', + 'wminc-viewuserlang-user' => 'Benotzernumm:', + 'wminc-viewuserlang-go' => 'Lass', + 'wminc-userdoesnotexist' => "De Benotzer ''$1'' gëtt et net.", + 'right-viewuserlang' => '[[Special:ViewUserLang|Benotzersprooch an Test-Wiki]] weisen', ); /** Limburgish (Limburgs) @@ -1227,24 +1340,33 @@ */ $messages['mk'] = array( 'wminc-desc' => 'Тестирање на вики-систем за Викимедија Инкубаторот', - 'wminc-viewuserlang' => 'Провери го јазикот на корисникот и неговото тест-вики', - 'wminc-viewuserlang-user' => 'Корисничко име:', - 'wminc-viewuserlang-go' => 'Оди', - 'wminc-userdoesnotexist' => 'Корисникот „$1“ не постои.', + 'wminc-manual' => 'Прирачник', + 'wminc-listwikis' => 'Список на викија', 'wminc-testwiki' => 'Тест-вики:', 'wminc-testwiki-none' => 'Ништо/Сè', + 'wminc-recentchanges-all' => 'Сите скорешни промени', 'wminc-prefinfo-language' => 'Јазикот на вашиот посредник - назависно од вашето тест-вики', 'wminc-prefinfo-code' => 'Јазичниот ISO 639 код', 'wminc-prefinfo-project' => 'Изберете го проектот (можноста за Инкубатор е за корисници кои работат општи задачи)', 'wminc-prefinfo-error' => 'Избравте проект на кој му треба јазичен код.', 'wminc-error-move-unprefixed' => 'Грешка: Страницата што сакате да ја преместите на [[{{MediaWiki:Helppage}}|нема префикс или префиксот ѝ е грешен]]!', - 'wminc-error-wronglangcode' => "'''Грешка:''' Страницата што сакате да ја уредите содржи [[{{MediaWiki:Helppage}}|погрешен јазичен код]] „$1“!", - 'wminc-error-unprefixed' => "'''Грешка:''' Страницата што сакате да ја уредите [[{{MediaWiki:Helppage}}|нема префикс]]!", - 'wminc-error-unprefixed-suggest' => "'''Грешка:''' Страницата што сакате да ја уредите [[{{MediaWiki:Helppage}}|нема префикс]]! Можете да создадете страница на [[:$1]].", - 'right-viewuserlang' => 'Погледајте [[Special:ViewUserLang|кориснички јазик и текст вики]]', + 'wminc-error-wronglangcode' => "'''Грешка:''' Страницава содржи [[{{MediaWiki:Helppage}}|погрешен јазичен код]] „$1“!", + 'wminc-error-unprefixed' => "'''Грешка:''' Страницава [[{{MediaWiki:Helppage}}|нема префикс]]!", + 'wminc-error-unprefixed-suggest' => "'''Грешка:''' Страницава [[{{MediaWiki:Helppage}}|нема префикс]]! Можете да создадете страница на [[:$1]].", + 'wminc-error-wiki-exists' => 'Ова вики веќе постои. Страницата ќе ја најдете на $1. Ако в икито е новосоздадено, почекајте неколку часа или дена за да се увезат сите содржини.', 'randombytest' => 'Случајна страница од тест вики', 'randombytest-nopages' => 'Не постојат страници на вашето пробно вики, во именскиот простор: $1.', - 'wminc-recentchanges-all' => 'Сите скорешни промени', + 'wminc-viewuserlang' => 'Провери го јазикот на корисникот и неговото тест-вики', + 'wminc-viewuserlang-user' => 'Корисничко име:', + 'wminc-viewuserlang-go' => 'Оди', + 'wminc-userdoesnotexist' => 'Корисникот „$1“ не постои.', + 'right-viewuserlang' => 'Погледајте [[Special:ViewUserLang|кориснички јазик и текст вики]]', + 'group-test-sysop' => 'Администратори на пробно вики', + 'group-test-sysop-member' => 'администратор на пробно вики', + 'grouppage-test-sysop' => 'Project:Администратори на пробни викија', + 'wminc-code-macrolanguage' => '[[wikipedia:$2 language|Јазикот „$3“]] е [[wikipedia:ISO 639 macrolanguage|макројазик]], кој се состои од следниве јазици:', + 'wminc-code-collective' => 'Кодот „$1“ не се однесува на поединечен јазик, туку на збирот јазици наречен [[wikipedia:$2 language|„$3“ јазици]].', + 'wminc-code-retired' => 'Овој јазичен код е изменет и повеќе не се однесува на првоназначениот јазик.', ); /** Malayalam (മലയാളം) @@ -1253,24 +1375,33 @@ */ $messages['ml'] = array( 'wminc-desc' => 'വിക്കിമീഡിയ ഇൻകുബേറ്ററിനുള്ള പരീക്ഷണ വിക്കി വ്യവസ്ഥ', - 'wminc-viewuserlang' => 'താങ്കളുടെ പരീക്ഷണ വിക്കിയും ഉപയോക്തൃഭാഷയും നോക്കുക', - 'wminc-viewuserlang-user' => 'ഉപയോക്തൃനാമം:', - 'wminc-viewuserlang-go' => 'പോകൂ', - 'wminc-userdoesnotexist' => '"$1" എന്ന ഉപയോക്താവ് നിലവിലില്ല.', + 'wminc-manual' => 'സഹായഗ്രന്ഥം', + 'wminc-listwikis' => 'വിക്കികളുടെ പട്ടിക', 'wminc-testwiki' => 'പരീക്ഷണ വിക്കി:', 'wminc-testwiki-none' => 'ഒന്നുമില്ല/എല്ലാം', + 'wminc-recentchanges-all' => 'എല്ലാ സമീപകാല മാറ്റങ്ങളും', 'wminc-prefinfo-language' => 'താങ്കളുടെ സമ്പർക്കമുഖ ഭാഷ - താങ്കളുടെ പരീക്ഷണ വിക്കിയിൽ നിന്ന് സ്വതന്ത്രം', 'wminc-prefinfo-code' => 'ISO 639 ഭാഷാ കോഡ്', 'wminc-prefinfo-project' => 'വിക്കിമീഡിയ പദ്ധതി തിരഞ്ഞെടുക്കുക (സാധാരണ പ്രവൃത്തികൾ ചെയ്യുന്ന ഉപയോക്താക്കൾക്കാണ് ഇൻകുബേറ്റർ ഐച്ഛികം)', 'wminc-prefinfo-error' => 'ഭാഷാ കോഡ് വേണ്ട ഒരു പദ്ധതിയാണ് താങ്കൾ തിരഞ്ഞെടുത്തിരിക്കുന്നത്.', 'wminc-error-move-unprefixed' => 'പിഴവ്: താങ്കൾ മാറ്റാൻ ശ്രമിക്കുന്ന താൾ [[{{MediaWiki:Helppage}}|പൂർവ്വപദം ഇല്ലാത്തതോ തെറ്റായി പൂർവ്വപദത്തോടു കൂടിയതോ ആണ്]]!', - 'wminc-error-wronglangcode' => "'''പിഴവ്:''' താങ്കൾ തിരുത്താൻ ശ്രമിക്കുന്ന താളിൽ [[{{MediaWiki:Helppage}}|തെറ്റായ ഭാഷാ കോഡ്]] \"\$1\" ആണുള്ളത്!", - 'wminc-error-unprefixed' => "'''പിഴവ്:''' താങ്കൾ തിരുത്താൻ ശ്രമിക്കുന്ന താളിന് [[{{MediaWiki:Helppage}}|പൂർവ്വപദമില്ല]]!", - 'wminc-error-unprefixed-suggest' => "'''പിഴവ്:''' താങ്കൾ തിരുത്താൻ ശ്രമിക്കുന്ന താളിന് [[{{MediaWiki:Helppage}}|പൂർവ്വപദമില്ല]]! താങ്കൾക്ക് [[:$1]]-ൽ ഒരു താൾ സൃഷ്ടിക്കാവുന്നതാണ്.", - 'right-viewuserlang' => '[[Special:ViewUserLang|ഉപയോക്തൃഭാഷയും പരീക്ഷണ വിക്കിയും]] കാണുക', + 'wminc-error-wronglangcode' => "'''പിഴവ്:''' ഈ താളിൽ [[{{MediaWiki:Helppage}}|തെറ്റായ ഭാഷാ കോഡ്]] \"\$1\" ആണുള്ളത്!", + 'wminc-error-unprefixed' => "'''പിഴവ്:''' ഈ താളിന് [[{{MediaWiki:Helppage}}|പൂർവ്വപദമില്ല]]!", + 'wminc-error-unprefixed-suggest' => "'''പിഴവ്:''' ഈ താളിന് [[{{MediaWiki:Helppage}}|പൂർവ്വപദമില്ല]]! താങ്കൾക്ക് [[:$1]]-ൽ ഒരു താൾ സൃഷ്ടിക്കാവുന്നതാണ്.", + 'wminc-error-wiki-exists' => 'ഈ വിക്കി നിലവിലുണ്ട്. ഈ താൾ താങ്കൾക്ക് $1-ൽ കാണാവുന്നതാണ്. ഈ വിക്കി സമീപകാലത്ത് സൃഷ്ടിച്ചതാണെങ്കിൽ, എല്ലാ ഉള്ളടക്കവും ഇറക്കുമതി ചെയ്യാനായി ഏതാനം മണിക്കൂറുകളോ ദിവസങ്ങളോ ദയവായി കാത്തിരിക്കുക.', 'randombytest' => 'പരീക്ഷണ വിക്കിയിൽ നിന്നും ക്രമരഹിതമായി എടുത്ത താൾ', 'randombytest-nopages' => 'ഈ നാമമേഖലയിൽ പരീക്ഷണ വിക്കിയിൽ താങ്കൾക്ക് ഒരു താളും ഇല്ല: $1.', - 'wminc-recentchanges-all' => 'എല്ലാ സമീപകാല മാറ്റങ്ങളും', + 'wminc-viewuserlang' => 'താങ്കളുടെ പരീക്ഷണ വിക്കിയും ഉപയോക്തൃഭാഷയും നോക്കുക', + 'wminc-viewuserlang-user' => 'ഉപയോക്തൃനാമം:', + 'wminc-viewuserlang-go' => 'പോകൂ', + 'wminc-userdoesnotexist' => '"$1" എന്ന ഉപയോക്താവ് നിലവിലില്ല.', + 'right-viewuserlang' => '[[Special:ViewUserLang|ഉപയോക്തൃഭാഷയും പരീക്ഷണ വിക്കിയും]] കാണുക', + 'group-test-sysop' => 'പരീക്ഷണവിക്കി കാര്യനിർവ്വാഹകർ', + 'group-test-sysop-member' => 'പരീക്ഷണവിക്കി കാര്യനിർവ്വാഹക(ൻ)', + 'grouppage-test-sysop' => 'Project:പരീക്ഷണവിക്കി കാര്യനിർവ്വാഹകർ', + 'wminc-code-macrolanguage' => '[[wikipedia:$2 language|"$3" എന്ന ഭാഷ]] ഒരു [[wikipedia:ISO 639 macrolanguage|ചെറുഭാഷയാണ്]], അത് ഉൾക്കൊള്ളുന്ന അംഗഭാഷകൾ ഇനി നൽകുന്നു:', + 'wminc-code-collective' => '"$1" എന്ന കോഡ് ഒരു പ്രത്യേക ഭാഷയെ പ്രതിനിധീകരിക്കുന്നില്ല, മറിച്ച് [[wikipedia:$2 language|"$3" ഭാഷകൾ]] എന്ന ഒരു കൂട്ടം ഭാഷകളാണ്.', + 'wminc-code-retired' => 'ഈ ഭാഷാ കോഡ് മാറിയിരിക്കുന്നു, യഥാർത്ഥ ഭാഷയെ അത് പ്രതിനിധീകരിക്കുന്നില്ല.', ); /** Mongolian (Монгол) @@ -1288,19 +1419,33 @@ */ $messages['ms'] = array( 'wminc-desc' => 'Sistem wiki ujian untuk Wikimedia Incubator', - 'wminc-viewuserlang' => 'Lihat bahasa pengguna dan wiki ujian', - 'wminc-viewuserlang-user' => 'Nama pengguna:', - 'wminc-viewuserlang-go' => 'Pergi', - 'wminc-userdoesnotexist' => 'Pengguna "$1" tidak wujud.', + 'wminc-manual' => 'Manual', + 'wminc-listwikis' => 'Senarai wiki', 'wminc-testwiki' => 'Wiki ujian:', 'wminc-testwiki-none' => 'Tiada/Semua', + 'wminc-recentchanges-all' => 'Semua perubahan terkini', 'wminc-prefinfo-language' => 'Bahasa antaramuka anda - bebas dari wiki ujian anda', 'wminc-prefinfo-code' => 'Kod bahasa ISO 639', 'wminc-prefinfo-project' => 'Pilih projek Wikimedia (pilihan Incubator ialah bagi pengguna yang membuat kerja umum)', 'wminc-prefinfo-error' => 'Anda memilih projek yang memerlukan kod bahasa.', - 'right-viewuserlang' => 'Melihat [[Special:ViewUserLang|bahasa pengguna dan wiki ujian]]', + 'wminc-error-move-unprefixed' => 'Ralat: Laman yang anda cuba pindahkan itu [[{{MediaWiki:Helppage}}|tiada awalan atau tersalah awalan]]!', + 'wminc-error-wronglangcode' => "'''Ralat:''' Laman ini mengandungi [[{{MediaWiki:Helppage}}|kod bahasa yang salah]] \"\$1\"!", + 'wminc-error-unprefixed' => "'''Ralat:''' Laman ini [[{{MediaWiki:Helppage}}|tiada awalan]]!", + 'wminc-error-unprefixed-suggest' => "'''Error:''' Laman ini [[{{MediaWiki:Helppage}}|tiada awalan]]! Anda boleh membuat laman baru di [[:$1]].", + 'wminc-error-wiki-exists' => 'Wiki ini sudah wujud. Anda boleh mencari laman ini di $1. Jika wiki itu baru dibuka, sila tunggu beberapa jam atau beberapa hari sehingga semua kandungan diimport.', 'randombytest' => 'Laman rawak oleh wiki ujian', 'randombytest-nopages' => 'Tidak terdapat laman dalam wiki ujian anda, dalam ruang nama: $1.', + 'wminc-viewuserlang' => 'Lihat bahasa pengguna dan wiki ujian', + 'wminc-viewuserlang-user' => 'Nama pengguna:', + 'wminc-viewuserlang-go' => 'Pergi', + 'wminc-userdoesnotexist' => 'Pengguna "$1" tidak wujud.', + 'right-viewuserlang' => 'Melihat [[Special:ViewUserLang|bahasa pengguna dan wiki ujian]]', + 'group-test-sysop' => 'Pentadbir wiki ujian', + 'group-test-sysop-member' => 'pentadir wiki ujian', + 'grouppage-test-sysop' => 'Project:Pentadbir wiki ujian', + 'wminc-code-macrolanguage' => '[[wikipedia:$2 language|Bahasa "$3"]] ialah sejenis [[wikipedia:ISO 639 macrolanguage|bahasa makro]], yang terdiri daripada bahasa-bahasa ahli yang berikut:', + 'wminc-code-collective' => 'Kod "$1" tidak merujuk kepada satu bahasa yang tertentu, sebaliknya merujuk kepada koleksi bahasa, iaitu [[wikipedia:$2 language|rumpun bahasa "$3"]].', + 'wminc-code-retired' => 'Kod bahasa ini sudah berubah dan tidak lagi merujuk kepada bahasa asal.', ); /** Maltese (Malti) @@ -1341,24 +1486,33 @@ */ $messages['nl'] = array( 'wminc-desc' => 'Testwiki-systeem voor Wikimedia Incubator', - 'wminc-viewuserlang' => 'Gebruikerstaal en testwiki opzoeken', - 'wminc-viewuserlang-user' => 'Gebruikersnaam:', - 'wminc-viewuserlang-go' => 'OK', - 'wminc-userdoesnotexist' => 'De gebruiker "$1" bestaat niet.', + 'wminc-manual' => 'Handleiding', + 'wminc-listwikis' => "Lijst met wiki's", 'wminc-testwiki' => 'Testwiki:', 'wminc-testwiki-none' => 'Geen/alles', + 'wminc-recentchanges-all' => 'Alle recente wijzigingen', 'wminc-prefinfo-language' => 'Uw interfacetaal - onafhankelijk van uw testwiki', 'wminc-prefinfo-code' => 'De ISO 639-taalcode', 'wminc-prefinfo-project' => 'Selecteer het Wikimedia-project (Incubator-optie is voor gebruikers die algemeen werk doen)', 'wminc-prefinfo-error' => 'U selecteerde een project dat een taalcode nodig heeft.', 'wminc-error-move-unprefixed' => 'Fout: De doelpagina waarnaar u probeert te hernoemen [[{{MediaWiki:Helppage}}|heeft geen of een verkeerd voorvoegsel]]!', - 'wminc-error-wronglangcode' => "'''Fout:''' De pagina die u probeert te bewerken bevat een [[{{MediaWiki:Helppage}}|verkeerde taalcode]] \"\$1\".", - 'wminc-error-unprefixed' => "'''Fout:''' De pagina die u probeert te bewerken heeft [[{{MediaWiki:Helppage}}|geen voorvoegsel]]!", - 'wminc-error-unprefixed-suggest' => "'''Fout:''' De pagina die u probeert te bewerken heeft [[{{MediaWiki:Helppage}}|geen voorvoegsel]]. U kunt een pagina aanmaken op [[:$1]].", - 'right-viewuserlang' => '[[Special:ViewUserLang|Gebruikerstaal en test wiki]] bekijken', + 'wminc-error-wronglangcode' => "'''Fout:''' Deze pagina bevat een [[{{MediaWiki:Helppage}}|verkeerde taalcode]] \"\$1\".", + 'wminc-error-unprefixed' => "'''Fout:''' Deze pagina heeft [[{{MediaWiki:Helppage}}|geen voorvoegsel]]!", + 'wminc-error-unprefixed-suggest' => "'''Fout:''' Deze pagina heeft [[{{MediaWiki:Helppage}}|geen voorvoegsel]]. U kunt een pagina aanmaken op [[:$1]].", + 'wminc-error-wiki-exists' => 'Deze wiki bestaat al. U kunt deze pagina vinden op $1. Als de wiki onlangs gemaakt is, wacht dan enkele uren of dagen totdat alle inhoud is geïmporteerd.', 'randombytest' => 'Willekeurige pagina uit testwiki', 'randombytest-nopages' => "Er zijn geen pagina's in uw testwiki in de naamruimte $1.", - 'wminc-recentchanges-all' => 'Alle recente wijzigingen', + 'wminc-viewuserlang' => 'Gebruikerstaal en testwiki opzoeken', + 'wminc-viewuserlang-user' => 'Gebruikersnaam:', + 'wminc-viewuserlang-go' => 'OK', + 'wminc-userdoesnotexist' => 'De gebruiker "$1" bestaat niet.', + 'right-viewuserlang' => '[[Special:ViewUserLang|Gebruikerstaal en test wiki]] bekijken', + 'group-test-sysop' => 'testwiki-beheerders', + 'group-test-sysop-member' => 'testwiki-beheerder', + 'grouppage-test-sysop' => 'Project:Testwiki-beheerders', + 'wminc-code-macrolanguage' => 'De [[wikipedia:$2 language|taal "$3"]] is een [[wikipedia:nl:Macrotaal|macrotaal]], die bestaat uit de volgende talen:', + 'wminc-code-collective' => 'De code "$1" verwijst niet naar een specifieke taal, maar naar een verzameling talen, namelijk de [[wikipedia:$2 language|"$3" talen.]]', + 'wminc-code-retired' => 'Deze taal code is gewijzigd en verwijst niet langer naar de oorspronkelijke taal.', ); /** Norwegian Nynorsk (Norsk (nynorsk)) @@ -1446,24 +1600,33 @@ */ $messages['pl'] = array( 'wminc-desc' => 'Testowa wiki dla Inkubatora Wikimedia', - 'wminc-viewuserlang' => 'Sprawdzanie języka użytk... [truncated message content] |
From: <ro...@us...> - 2011-07-24 20:36:10
|
Revision: 27 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=27&view=rev Author: robin-p Date: 2011-07-24 20:36:03 +0000 (Sun, 24 Jul 2011) Log Message: ----------- Several merges with trunk (other commit(s) following) Modified Paths: -------------- trunk/InfoPage.css trunk/SpecialViewUserLang.php trunk/TestWikiRC.php trunk/WikimediaIncubator.dev-i18n.php Modified: trunk/InfoPage.css =================================================================== --- trunk/InfoPage.css 2011-07-18 14:36:19 UTC (rev 26) +++ trunk/InfoPage.css 2011-07-24 20:36:03 UTC (rev 27) @@ -1,29 +1,55 @@ -/*.infopage-default { background-color:#FCFCFC; border:2px solid silver; } -.infopage-tocreate { background-color:#FCFCFC; border:2px solid silver; } -.infopage-approved { background-color:#F3FFF3; border:2px solid green; } -.infopage-invalidcode { background-color:#FFDBDB; border:2px solid red; } -.infopage-open { background-color:#F3F3FF; border:2px solid blue; } -.infopage-imported { background-color:#FAF6ED; border:2px solid orange; }*/ -.wminc-infopage-title { padding:8px; font-size:180%; } -.wminc-infopage-entertest { margin-left:1em; } +.wminc-infopage-title { + padding:8px; + font-size:180%; +} +.wminc-infopage-entertest { + margin-left:1em; +} .noarticletext, .mw-warning-with-logexcerpt, .firstHeading { - display: none; /* FIXME: is it possible to hide firstHeading only for non-existing pages? */ + display: none; } .wminc-infopage { font-size: 125%; font-family: 'Lucida Sans', Verdana, sans-serif; padding: .6em; margin: .5em 0; } -.wminc-infopage p { margin: .2em 0 .3em; } -.wminc-infopage li { padding:.2em 0 .3em; } -.wminc-infopage-welcome { font-style: italic; } -ul.wminc-infopage-otherprojects, ul.wminc-infopage-multilingualprojects { list-style: none; } -.wminc-infopage-otherprojects li, .wminc-infopage-multilingualprojects li { display: inline; padding:.5em; } -.wminc-infopage-title { font-size:145%; padding:.3em 0; font-weight:bold; } -.wminc-infopage-text { font-size: 125%; } -.wminc-infopage-options { padding: .2em; } -.wminc-infopage-logo { float: right; } -.wminc-infopage-createmainpage { margin-left: .5em; font-weight: bold; } -.wminc-infopage-status { margin: 1em; } -#ca-nstab-main a { color: black; } -#siteNotice { border-bottom: 1px solid silver; } \ No newline at end of file +.wminc-infopage p, .wminc-infopage li { + padding:.2em 0 .3em; +} +.wminc-infopage-welcome { + font-style: italic; +} +ul.wminc-infopage-otherprojects, ul.wminc-infopage-multilingualprojects { + list-style: none; +} +.wminc-infopage-otherprojects li, .wminc-infopage-multilingualprojects li { + display: inline; + padding:.5em; +} +.wminc-infopage-title { + font-size:145%; + padding:.3em 0; + font-weight:bold; +} +.wminc-infopage-text { + font-size: 125%; +} +.wminc-infopage-options { + padding: .2em; +} +.wminc-infopage-logo { + float: right; +} +.wminc-infopage-createmainpage { + margin-left: .5em; + font-weight: bold; +} +.wminc-infopage-status { + margin: 1em; +} +#ca-nstab-main a { + color: black; +} +#siteNotice { + border-bottom: 1px solid silver; +} \ No newline at end of file Modified: trunk/SpecialViewUserLang.php =================================================================== --- trunk/SpecialViewUserLang.php 2011-07-18 14:36:19 UTC (rev 26) +++ trunk/SpecialViewUserLang.php 2011-07-24 20:36:03 UTC (rev 27) @@ -72,6 +72,7 @@ $name = $user->getName(); $id = $user->getId(); $langNames = Language::getLanguageNames(); + $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; if ( $user == null || $id == 0 ) { // show error if a user with that name does not exist $wgOut->addHTML( Xml::span( wfMsg( 'wminc-userdoesnotexist', $target ), 'error' ) ); @@ -81,7 +82,7 @@ $usercode = $user->getOption( $wmincPref . '-code' ); $prefix = IncubatorTest::displayPrefix( $userproject, $usercode ); if ( IncubatorTest::isContentProject( $userproject ) ) { - $testwiki = Linker::link( Title::newFromText( $prefix ) ); + $testwiki = $linker->link( Title::newFromText( $prefix ) ); } elseif ( $prefix == $wmincProjectSite['short'] ) { $testwiki = htmlspecialchars( $wmincProjectSite['name'] ); } else { @@ -90,7 +91,7 @@ $wgOut->addHtml( Xml::openElement( 'ul' ) . '<li>' . wfMsgHtml( 'username' ) . ' ' . - Linker::userLink( $id, $name ) . Linker::userToolLinks( $id, $name, true ) . '</li>' . + $linker->userLink( $id, $name ) . $linker->userToolLinks( $id, $name, true ) . '</li>' . '<li>' . wfMsgHtml( 'loginlanguagelabel', $langNames[$user->getOption( 'language' )] . ' (' . $user->getOption( 'language' ) . ')' ) . '</li>' . '<li>' . wfMsgHtml( 'wminc-testwiki' ) . ' ' . $testwiki . '</li>' . Modified: trunk/TestWikiRC.php =================================================================== --- trunk/TestWikiRC.php 2011-07-18 14:36:19 UTC (rev 26) +++ trunk/TestWikiRC.php 2011-07-24 20:36:03 UTC (rev 27) @@ -4,14 +4,23 @@ * * @file * @ingroup Extensions - * @author Robin Pepermans + * @author Robin Pepermans (SPQRobin) */ class TestWikiRC { + static function getValues() { + global $wgUser, $wmincPref, $wgRequest; + $url = IncubatorTest::getUrlParam(); + $projectvalue = $url ? $url['project'] : $wgUser->getOption( $wmincPref . '-project' ); + $codevalue = $url ? $url['lang'] : $wgUser->getOption( $wmincPref . '-code' ); + $projectvalue = strtolower( $wgRequest->getVal( 'rc-testwiki-project', $projectvalue ) ); + $codevalue = strtolower( $wgRequest->getVal( 'rc-testwiki-code', $codevalue ) ); + return array( $projectvalue, $codevalue ); + } + static function onRcQuery( &$conds, &$tables, &$join_conds, $opts ) { - global $wgUser, $wgRequest, $wmincPref, $wmincProjectSite, $wmincProjects, $wmincTestWikiNamespaces; - $projectvalue = strtolower( $wgRequest->getVal( 'rc-testwiki-project', $wgUser->getOption($wmincPref . '-project') ) ); - $codevalue = strtolower( $wgRequest->getVal( 'rc-testwiki-code', $wgUser->getOption($wmincPref . '-code') ) ); + global $wmincProjectSite, $wmincTestWikiNamespaces; + list( $projectvalue, $codevalue ) = self::getValues(); $prefix = IncubatorTest::displayPrefix( $projectvalue, $codevalue ); $opts->add( 'rc-testwiki-project', false ); $opts->setValue( 'rc-testwiki-project', $projectvalue ); @@ -30,12 +39,6 @@ $conds['rc_namespace'] = $wmincTestWikiNamespaces; $conds[] = 'rc_title ' . $dbr->buildLike( $prefix . '/', $dbr->anyString() ) . ' OR rc_title = ' . $dbr->addQuotes( $prefix ); - } elseif( isset( $wmincProjects[$projectvalue] ) ) { - // When only a project selected, show all edits in all test wikis of that project - $dbr = wfGetDB( DB_SLAVE ); - $conds['rc_namespace'] = $wmincTestWikiNamespaces; - $conds[] = 'rc_title ' . $dbr->buildLike( 'W' . $projectvalue . '/', $dbr->anyString() ) . - ' OR rc_title ' . $dbr->buildLike( 'W' . $projectvalue ); } else { return true; } @@ -43,10 +46,9 @@ } static function onRcForm( &$items, $opts ) { - global $wgUser, $wgRequest, $wmincPref, $wmincProjects, $wmincProjectSite, $wmincLangCodeLength; + global $wmincProjects, $wmincProjectSite, $wmincLangCodeLength; - $projectvalue = $wgRequest->getVal( 'rc-testwiki-project', $wgUser->getOption($wmincPref . '-project') ); - $langcodevalue = $wgRequest->getVal( 'rc-testwiki-code', $wgUser->getOption($wmincPref . '-code') ); + list( $projectvalue, $codevalue ) = self::getValues(); $opts->consumeValue( 'rc-testwiki-project' ); $opts->consumeValue( 'rc-testwiki-code' ); $label = Xml::label( wfMsg( 'wminc-testwiki' ), 'rc-testwiki' ); @@ -56,7 +58,7 @@ $select->addOption( $name, $prefix ); } $select->addOption( $wmincProjectSite['name'], $wmincProjectSite['short'] ); - $langcode = Xml::input( 'rc-testwiki-code', (int)$wmincLangCodeLength, $langcodevalue, + $langcode = Xml::input( 'rc-testwiki-code', (int)$wmincLangCodeLength, $codevalue, array( 'id' => 'rc-testwiki-code', 'maxlength' => (int)$wmincLangCodeLength ) ); $items['testwiki'] = array( $label, $select->getHTML() . ' ' . $langcode ); return true; Modified: trunk/WikimediaIncubator.dev-i18n.php =================================================================== --- trunk/WikimediaIncubator.dev-i18n.php 2011-07-18 14:36:19 UTC (rev 26) +++ trunk/WikimediaIncubator.dev-i18n.php 2011-07-24 20:36:03 UTC (rev 27) @@ -15,9 +15,6 @@ 'wminc-incubatorexport' => 'Export pages from a test wiki', 'wminc-requestwiki' => 'Request a new wiki', - 'wminc-error-wiki-exists' => 'This wiki already exists. You can find this page on $1. If the wiki was recently created, -please wait a few hours or days until all content is imported.', - 'wminc-languages' => 'Languages', 'wminc-languages-intro' => 'This is a list of languages that are defined in [[$1]].', 'wminc-languages-error' => 'There are no languages defined in [[$1]], or there was another error.', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hy...@us...> - 2011-07-18 14:36:25
|
Revision: 26 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=26&view=rev Author: hydria Date: 2011-07-18 14:36:19 +0000 (Mon, 18 Jul 2011) Log Message: ----------- Just some code for UI, taken from PrefixExport. Do not expect things to work yet... Modified Paths: -------------- trunk/SpecialIncubatorExport.php trunk/SpecialRequestWiki.php trunk/WikimediaIncubator.dev-i18n.php Modified: trunk/SpecialIncubatorExport.php =================================================================== --- trunk/SpecialIncubatorExport.php 2011-07-16 14:52:59 UTC (rev 25) +++ trunk/SpecialIncubatorExport.php 2011-07-18 14:36:19 UTC (rev 26) @@ -43,7 +43,20 @@ */ function showForm( $target ) { global $wgOut; - $wgOut->addHtml('to do'); + $wgOut->addHtml('Expected to complete around 1st November 2011 latest, hope I can finish :)'); + $wgOut->addHTML( + Xml::fieldset( wfMsgHtml( 'wminc-export-title' ) ) . + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $wgScript ) ) . + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . + "<p>" . + Xml::inputLabel( wfMsgHtml( 'wminc-export-prefix' ), 'target', 'wminc-export-prefix', 40, $target ) . + ' ' . + Xml::submitButton( wfMsgHtml( 'wminc-export-go' ) ) . + "</p>" . + Xml::closeElement( 'form' ) . + Xml::closeElement( 'fieldset' ) + ); + } /** Modified: trunk/SpecialRequestWiki.php =================================================================== --- trunk/SpecialRequestWiki.php 2011-07-16 14:52:59 UTC (rev 25) +++ trunk/SpecialRequestWiki.php 2011-07-18 14:36:19 UTC (rev 26) @@ -87,4 +87,4 @@ $wgOut->addHTML('<h3>'.$projectname.' '.$languages[$lang].'</h3><p>Requirements to be fulfilled:</p> <ul>'.$itemlist.'</ul>'); } -} \ No newline at end of file +} Modified: trunk/WikimediaIncubator.dev-i18n.php =================================================================== --- trunk/WikimediaIncubator.dev-i18n.php 2011-07-16 14:52:59 UTC (rev 25) +++ trunk/WikimediaIncubator.dev-i18n.php 2011-07-18 14:36:19 UTC (rev 26) @@ -28,6 +28,9 @@ 'wminc-languages-script' => 'Scripts', 'wminc-languages-valid' => 'Code validity', 'wminc-languages-projects' => 'Projects', + 'wminc-export-title' => 'Export pages from within a prefix', + 'wminc-export-prefix' => 'Prefix:', + 'wminc-export-go' => 'Go', ); /** Nederlands (Dutch) @@ -46,4 +49,4 @@ 'group-test-sysop' => 'Lokale beheerders', 'group-test-sysop-member' => 'lokale beheerder', 'grouppage-test-sysop' => 'Project:Lokale beheerders', -); \ No newline at end of file +); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-07-16 14:53:05
|
Revision: 25 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=25&view=rev Author: robin-p Date: 2011-07-16 14:52:59 +0000 (Sat, 16 Jul 2011) Log Message: ----------- Add a simple special page that goes to the main page of your test wiki. Also added in MW SVN. Modified Paths: -------------- trunk/WikimediaIncubator.php Added Paths: ----------- trunk/SpecialMyMainPage.php Added: trunk/SpecialMyMainPage.php =================================================================== --- trunk/SpecialMyMainPage.php (rev 0) +++ trunk/SpecialMyMainPage.php 2011-07-16 14:52:59 UTC (rev 25) @@ -0,0 +1,39 @@ +<?php +/** + * Special page to go to the Main Page, depending on your test wiki. + * Goes to the default Main Page if the test wiki preference + * is set to None/All or Incubator. + * + * @file + * @ingroup SpecialPage + */ + +class SpecialMyMainPage extends UnlistedSpecialPage { + + public function __construct() { + parent::__construct( 'MyMainPage' ); + } + + public function execute() { + global $wgOut; + + $title = ''; + $params = array(); + + if( IncubatorTest::isContentProject() ) { + global $wgRequest; + $title = Title::newFromText( IncubatorTest::displayPrefix() ); + if( $wgRequest->getVal( 'goto' ) != 'infopage' ) { + # Used in development version + $params = array( 'goto' => 'mainpage' ); + } + } + + # Go to the main page if given invalid title, or if it's not a content project + if ( !$title ) { + $title = Title::newMainPage(); + } + + $wgOut->redirect( $title->getLocalURL( $params ) ); + } +} \ No newline at end of file Property changes on: trunk/SpecialMyMainPage.php ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-07-15 21:52:53 UTC (rev 24) +++ trunk/WikimediaIncubator.php 2011-07-16 14:52:59 UTC (rev 25) @@ -15,7 +15,7 @@ 'path' => __FILE__, 'name' => 'Wikimedia Incubator', 'author' => array( 'SPQRobin', 'Hydriz' ), - 'version' => 'dev, synced to 3.1.1 in svn', + 'version' => 'dev, synced to 3.2 in svn', 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator', 'descriptionmsg' => 'wminc-desc', ); @@ -86,6 +86,10 @@ $wgHooks['LanguageGetMagic'][] = 'IncubatorTest::magicWord'; $wgHooks['ParserGetVariableValueSwitch'][] = 'IncubatorTest::magicWordValue'; +/* Special:MyMainPage (depending on your test wiki preference) */ +$wgAutoloadClasses['SpecialMyMainPage'] = $dir . 'SpecialMyMainPage.php'; +$wgSpecialPages['MyMainPage'] = 'SpecialMyMainPage'; + /* Create/move page permissions */ $wgHooks['getUserPermissionsErrors'][] = 'IncubatorTest::onGetUserPermissionsErrors'; $wgHooks['AbortMove'][] = 'IncubatorTest::checkPrefixMovePermissions'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-07-15 21:52:59
|
Revision: 24 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=24&view=rev Author: robin-p Date: 2011-07-15 21:52:53 +0000 (Fri, 15 Jul 2011) Log Message: ----------- * Added test wiki admin group to MW SVN -> update here * Put some config things that are not in MW SVN at the botttom Modified Paths: -------------- trunk/WikimediaIncubator.dev-i18n.php trunk/WikimediaIncubator.i18n.php trunk/WikimediaIncubator.php Modified: trunk/WikimediaIncubator.dev-i18n.php =================================================================== --- trunk/WikimediaIncubator.dev-i18n.php 2011-07-15 21:33:50 UTC (rev 23) +++ trunk/WikimediaIncubator.dev-i18n.php 2011-07-15 21:52:53 UTC (rev 24) @@ -28,10 +28,6 @@ 'wminc-languages-script' => 'Scripts', 'wminc-languages-valid' => 'Code validity', 'wminc-languages-projects' => 'Projects', - - 'group-test-sysop' => 'Test wiki administrators', - 'group-test-sysop-member' => 'test wiki administrator', - 'grouppage-test-sysop' => 'Project:Test wiki administrators', ); /** Nederlands (Dutch) Modified: trunk/WikimediaIncubator.i18n.php =================================================================== --- trunk/WikimediaIncubator.i18n.php 2011-07-15 21:33:50 UTC (rev 23) +++ trunk/WikimediaIncubator.i18n.php 2011-07-15 21:52:53 UTC (rev 24) @@ -30,6 +30,10 @@ 'randombytest' => 'Random page by test wiki', 'randombytest-nopages' => 'There are no pages in your test wiki, in the namespace: $1.', 'wminc-recentchanges-all' => 'All recent changes', + + 'group-test-sysop' => 'Test wiki administrators', + 'group-test-sysop-member' => 'test wiki administrator', + 'grouppage-test-sysop' => 'Project:Test wiki administrators', ); /** Message documentation (Message documentation) Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-07-15 21:33:50 UTC (rev 23) +++ trunk/WikimediaIncubator.php 2011-07-15 21:52:53 UTC (rev 24) @@ -39,21 +39,10 @@ 'q' => 'Wikiquote', 'n' => 'Wikinews', ); -# Sister projects is here defined as projects that are not on Incubator -$wmincSisterProjects = array( - 's' => 'Wikisource', - 'v' => 'Wikiversity', -); $wmincProjectSite = array( 'name' => 'Incubator', 'short' => 'inc', ); -$wmincMultilingualProjects = array( - 'meta.wikimedia.org' => 'Meta-Wiki', - 'commons.wikimedia.org' => 'Wikimedia Commons', - 'species.wikimedia.org' => 'Wikispecies', - 'mediawiki.org' => 'MediaWiki', -); $wmincTestWikiNamespaces = array( NS_MAIN, NS_TALK, NS_TEMPLATE, NS_TEMPLATE_TALK, @@ -65,6 +54,16 @@ 'Incubator', 'Help', 'Users', 'Maintenance', 'Files', ); +/* Test wiki admin user group */ +$wgGroupPermissions['test-sysop']['delete'] = true; +$wgGroupPermissions['test-sysop']['undelete'] = true; +$wgGroupPermissions['test-sysop']['deletedhistory'] = true; +$wgGroupPermissions['test-sysop']['block'] = true; +$wgGroupPermissions['test-sysop']['blockemail'] = true; +$wgGroupPermissions['test-sysop']['rollback'] = true; +$wgAddGroups['bureaucrat']['test-sysop'] = true; +$wgRemoveGroups['bureaucrat']['test-sysop'] = true; + $wgExtensionMessagesFiles['WikimediaIncubator'] = $dir . 'WikimediaIncubator.i18n.php'; $wgResourceModules['WikimediaIncubator.InfoPage'] = array( @@ -107,6 +106,19 @@ /* ==================== BEGIN OF STUFF IN DEVELOPMENT ================ */ +# Sister projects is here defined as projects that are not on Incubator +$wmincSisterProjects = array( + 's' => 'Wikisource', + 'v' => 'Wikiversity', +); + +$wmincMultilingualProjects = array( + 'meta.wikimedia.org' => 'Meta-Wiki', + 'commons.wikimedia.org' => 'Wikimedia Commons', + 'species.wikimedia.org' => 'Wikispecies', + 'mediawiki.org' => 'MediaWiki', +); + /* Get the big $wmincLanguageCodes array which can be updated through the generateCodeList.php script */ require_once( 'codelist.php' ); @@ -129,16 +141,6 @@ /* Messages not in SVN */ $wgExtensionMessagesFiles['WikimediaIncubator-dev'] = $dir . 'WikimediaIncubator.dev-i18n.php'; -/* Test admin user group */ # OK -$wgGroupPermissions['test-sysop']['delete'] = true; -$wgGroupPermissions['test-sysop']['undelete'] = true; -$wgGroupPermissions['test-sysop']['deletedhistory'] = true; -$wgGroupPermissions['test-sysop']['block'] = true; -$wgGroupPermissions['test-sysop']['blockemail'] = true; -$wgGroupPermissions['test-sysop']['rollback'] = true; -$wgAddGroups['bureaucrat']['test-sysop'] = true; -$wgRemoveGroups['bureaucrat']['test-sysop'] = true; - /* Logo */ # STABLE FEATURE (not sure whether needed) $wgHooks['BeforePageDisplay'][] = 'IncubatorTest::fnTestWikiLogo'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-07-15 21:34:01
|
Revision: 23 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=23&view=rev Author: robin-p Date: 2011-07-15 21:33:50 +0000 (Fri, 15 Jul 2011) Log Message: ----------- * Some updates, including better documentation * Remove empty TestWikiDB.php * Re-rename "local admins" to "test wiki admins" * Sync i18n file with the one in WM svn Modified Paths: -------------- trunk/CreateAccountTestWiki-alt.php trunk/CreateAccountTestWiki.php trunk/IncubatorLanguages.php trunk/IncubatorTest.php trunk/InfoPage.css trunk/InfoPage.php trunk/SpecialIncubatorExport.php trunk/SpecialLanguages (using db,log).php trunk/SpecialLanguages.php trunk/SpecialRandomByTest.php trunk/SpecialRequestWiki.php trunk/SpecialTestWikiContributions.php trunk/SpecialViewUserLang.php trunk/TestWikiRC.php trunk/WikimediaIncubator.dev-i18n.php trunk/WikimediaIncubator.i18n.php trunk/WikimediaIncubator.php Removed Paths: ------------- trunk/TestWikiDB.php Modified: trunk/CreateAccountTestWiki-alt.php =================================================================== --- trunk/CreateAccountTestWiki-alt.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/CreateAccountTestWiki-alt.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,12 +1,18 @@ <?php -/* -* Adds an input box so users can enter their test wiki -* on the account creation form, to be used as user preference. -* The URL parameter "testwiki" can be used to pre-fill this box. -* This can be used to work with links on other sites -* referring to the account creation form so users don't *have* to -* change their preferences (automatically is always better :p) -*/ +/** + * Adds an input box so users can enter their test wiki + * on the account creation form, to be used as user preference. + * The URL parameter "testwiki" can be used to pre-fill this box. + * This can be used to work with links on other sites + * referring to the account creation form so users don't *have* to + * change their preferences (automatically is always better :p) + * + * @file + * @ingroup Extensions + * @author Robin Pepermans (SPQRobin) + * @todo Make the select work, so this file can replace CreateAccountTestWiki.php + */ + class AutoTestWiki { public static function onUserCreateForm( $template ) { global $wgRequest, $wmincProjects; Modified: trunk/CreateAccountTestWiki.php =================================================================== --- trunk/CreateAccountTestWiki.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/CreateAccountTestWiki.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,11 +1,16 @@ <?php -/* -* If URL parameters "testwikiproject" and "testwikicode" are set -* on account creation form, set them as user preference. -* This can be used to work with links on other sites -* referring to the account creation form so users don't *have* to -* change their preferences (automatically is always better :p) -*/ +/** + * If URL parameters "testwikiproject" and "testwikicode" are set + * on account creation form, set them as user preference. + * This can be used to work with links on other sites + * referring to the account creation form so users don't *have* to + * change their preferences (automatically is always better :p) + * + * @file + * @ingroup Extensions + * @author Robin Pepermans (SPQRobin) + */ + class AutoTestWiki { public static function onUserCreateForm( $template ) { global $wgRequest, $wmincProjects; Modified: trunk/IncubatorLanguages.php =================================================================== --- trunk/IncubatorLanguages.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/IncubatorLanguages.php 2011-07-15 21:33:50 UTC (rev 23) @@ -2,6 +2,10 @@ /** * This class loads data about all defined languages. * Used on Special:Languages (as an overview) + ?? + * + * @file + * @ingroup Extensions + * @author Robin Pepermans (SPQRobin) */ class IncubatorLanguages { @@ -61,7 +65,7 @@ * 'code' => array( 'type' => '...', 'name' => 'value' ), */ static public function loadLanguagesData() { - global $wmincProjectSite, $wgMemc; + global $wmincProjectSite, $wgMemc, $wmincLanguageCodes; # Use caching if possible $key = wfMemcKey( 'wminc-languagesdata' ); $cachedData = $wgMemc->get( $key ); Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/IncubatorTest.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,11 +1,19 @@ <?php /** - * Main class of the incubator extension. + * Main class of the WikimediaIncubator extension. * Implement test wiki preference, magic word and prefix check on edit page, * and contains general functions for other classes. + * + * @file + * @ingroup Extensions + * @author Robin Pepermans (SPQRobin) */ class IncubatorTest { + + /** + * Add preferences + */ static function onGetPreferences( $user, &$preferences ) { global $wmincPref, $wmincProjects, $wmincProjectSite, $wmincLangCodeLength, $wgDefaultUserOptions; @@ -42,6 +50,9 @@ return true; } + /** + * For the preferences above + */ static function validateCodePreference( $input, $alldata ) { global $wmincPref, $wmincProjects; # If the user selected a project that NEEDS a language code, @@ -64,7 +75,9 @@ static function validateLanguageCode( $code ) { global $wmincLangCodeLength; if( strlen( $code ) > $wmincLangCodeLength ) { return false; } - if( $code == 'be-x-old' ) { return true; } // one exception... + if( $code == 'be-x-old' ) { + return true; # one exception... waiting to be renamed to be-tarask + } return (bool) preg_match( '/^[a-z][a-z][a-z]?(-[a-z]+)?$/', $code ); } @@ -79,7 +92,8 @@ * @param $title String The given title (often $wgTitle->getText() ) * @param $onlyInfoPage Bool Whether to validate only the prefix, or * also allow other text within the page title (Wx/xxx vs Wx/xxx/Text) - * @return Array + * @return Array with 'error' or 'project', 'lang', 'prefix' and + * optionally 'realtitle' */ static function analyzePrefix( $title, $onlyInfoPage = false ) { $data = array( 'error' => null ); @@ -155,6 +169,7 @@ /** * Makes a full prefixed title of a given page title and namespace * @param $ns Int numeric value of namespace + * @return object Title */ static function displayPrefixedTitle( $title, $ns = 0 ) { global $wgLang, $wmincTestWikiNamespaces; @@ -199,6 +214,7 @@ * Disables editing pages belonging to existing wikis (+ shows message) * Disables creating an unprefixed page (+ shows error message) * See also: IncubatorTest::onShowMissingArticle() + * @return Boolean */ static function onGetUserPermissionsErrors( $title, $user, $action, &$result ) { global $wmincProjectSite, $wmincProjects, $wmincTestWikiNamespaces, $wmincPseudoCategoryNSes; @@ -248,8 +264,9 @@ } /** - * Return an error if the user wants to move + * Return an error if the user wants to move * an existing page to an unprefixed title + * @return Boolean */ static function checkPrefixMovePermissions( $oldtitle, $newtitle, $user, &$error ) { global $wmincProjectSite, $wmincTestWikiNamespaces; Modified: trunk/InfoPage.css =================================================================== --- trunk/InfoPage.css 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/InfoPage.css 2011-07-15 21:33:50 UTC (rev 23) @@ -25,4 +25,5 @@ .wminc-infopage-logo { float: right; } .wminc-infopage-createmainpage { margin-left: .5em; font-weight: bold; } .wminc-infopage-status { margin: 1em; } -#ca-nstab-main a { color: black; } \ No newline at end of file +#ca-nstab-main a { color: black; } +#siteNotice { border-bottom: 1px solid silver; } \ No newline at end of file Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/InfoPage.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,5 +1,7 @@ <?php -/* +/** + * Implements the "info page" + 'missing' showMissingWiki() A [Project] in this language does not yet exist. 'incubator' showIncubatingWiki() @@ -9,9 +11,13 @@ 'approved': This Incubator wiki has been approved by the language committee and will soon be created. 'existing' showExistingWiki() 'created': This project has been approved by the language committee and is now available at xyz.wikiproject.org. - 'beforeincubator': This project was created before Wikimedia Incubator started and is available at xyz.wikiproject.org. -*/ -# This class is used for "Wx/xx(x)" pages + 'beforeincubator': This project was created before Wikimedia Incubator started and is available at xyz.wikiproject.org. + + * @file + * @ingroup Extensions + * @author Robin Pepermans (SPQRobin) + */ + class InfoPage { public function __construct( $title, $prefixdata ) { global $wmincProjects; Modified: trunk/SpecialIncubatorExport.php =================================================================== --- trunk/SpecialIncubatorExport.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/SpecialIncubatorExport.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,11 +1,16 @@ <?php /** -* Special page to export all pages of a specific test wiki + * Special page to export all pages of a specific test wiki + * * @file + * @ingroup SpecialPage + * @author RobinPepermans + * @author Hydriz + * + * @todo Make this do something! :) */ -class SpecialIncubatorExport extends SpecialPage -{ +class SpecialIncubatorExport extends SpecialPage { public function __construct() { parent::__construct( 'IncubatorExport' ); } @@ -18,15 +23,10 @@ */ public function execute( $subpage ) { global $wgRequest, $wgUser; - wfLoadExtensionMessages( 'WikimediaIncubator' ); $this->setHeaders(); - if ( $subpage ) { - $target = $subpage; - } else { - $target = $wgRequest->getText( 'target' ); - } + $target = $wgRequest->getText( 'target', $subpage ); $this->showForm( $target ); Modified: trunk/SpecialLanguages (using db,log).php =================================================================== --- trunk/SpecialLanguages (using db,log).php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/SpecialLanguages (using db,log).php 2011-07-15 21:33:50 UTC (rev 23) @@ -27,8 +27,6 @@ function execute( $par ) { global $wgRequest, $wgOut, $wgUser; - wfLoadExtensionMessages( 'TestWikiDB' ); - $admin = $wgUser->isAllowed( 'editlangs' ); $this->setHeaders(); Modified: trunk/SpecialLanguages.php =================================================================== --- trunk/SpecialLanguages.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/SpecialLanguages.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,8 +1,12 @@ <?php /** - * implements Special:Languages, based on + * implements Special:Languages + * + * @file * @ingroup SpecialPage + * @author Robin Pepermans (SPQRobin) */ + class SpecialLanguages extends SpecialPage { function __construct() { parent::__construct( 'Languages' ); Modified: trunk/SpecialRandomByTest.php =================================================================== --- trunk/SpecialRandomByTest.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/SpecialRandomByTest.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,11 +1,14 @@ <?php /** -* Special page to go to a random page in your test wiki + * Special page to go to a random page in your test wiki + * (or a specific wiki if it is defined through &testwiki=Wx/xx) + * * @file + * @ingroup SpecialPage + * @author Robin Pepermans (SPQRobin) */ -class SpecialRandomByTest extends RandomPage -{ +class SpecialRandomByTest extends RandomPage { public function __construct() { global $wgUser, $wgRequest, $wmincPref, $wmincProjectSite; $target = $wgRequest->getVal( 'testwiki' ); @@ -18,9 +21,9 @@ $dbr->buildLike( IncubatorTest::displayPrefix( $project, $lang ) . '/', $dbr->anyString() ); } elseif($wgUser->getOption($wmincPref . '-project') == $wmincProjectSite['short'] ) { global $wgVersion; - // only works above MW 1.17 + # only works above MW 1.17 if( version_compare($wgVersion, '1.17', '>') ) { - // project or help namespace + # project or help namespace $this->extra['page_namespace'] = array( 4, 12 ); } } Modified: trunk/SpecialRequestWiki.php =================================================================== --- trunk/SpecialRequestWiki.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/SpecialRequestWiki.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,10 +1,14 @@ <?php /** - * Special page to request a new subdomain. (experimental) + * Special page to request a new subdomain. + * + * [Low-priority, optional feature] + * + * @file + * @ingroup SpecialPage */ -class SpecialRequestWiki extends SpecialPage -{ +class SpecialRequestWiki extends SpecialPage { public function __construct() { parent::__construct( 'RequestWiki' ); } Modified: trunk/SpecialTestWikiContributions.php =================================================================== --- trunk/SpecialTestWikiContributions.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/SpecialTestWikiContributions.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,4 +1,12 @@ <?php +/** + * Test wiki contributions + * + * @file + * @ingroup Extensions + * + * @todo Make this work + */ class SpecialTestWikiContributions extends SpecialContributions { @@ -7,7 +15,6 @@ } function getDescription() { - wfLoadExtensionMessages( 'WikimediaIncubator' ); return wfMsg( 'wminc-testwikicontributions' ); } Modified: trunk/SpecialViewUserLang.php =================================================================== --- trunk/SpecialViewUserLang.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/SpecialViewUserLang.php 2011-07-15 21:33:50 UTC (rev 23) @@ -7,10 +7,11 @@ * Based on code from extension LookupUser made by Tim Starling * * @file + * @ingroup SpecialPage + * @author Robin Pepermans (SPQRobin) */ -class SpecialViewUserLang extends SpecialPage -{ +class SpecialViewUserLang extends SpecialPage { public function __construct() { parent::__construct( 'ViewUserLang', 'viewuserlang' ); } @@ -23,7 +24,6 @@ */ public function execute( $subpage ) { global $wgRequest, $wgUser; - $this->setHeaders(); Deleted: trunk/TestWikiDB.php =================================================================== --- trunk/TestWikiDB.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/TestWikiDB.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,5 +0,0 @@ -<?php - -class TestWikiDB -{ -} \ No newline at end of file Modified: trunk/TestWikiRC.php =================================================================== --- trunk/TestWikiRC.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/TestWikiRC.php 2011-07-15 21:33:50 UTC (rev 23) @@ -1,7 +1,11 @@ <?php -/* -* Recent changes for a specific test wiki, or for all project changes (or normal display) -*/ +/** + * Recent changes for a specific test wiki, or for all project changes (or normal display) + * + * @file + * @ingroup Extensions + * @author Robin Pepermans + */ class TestWikiRC { static function onRcQuery( &$conds, &$tables, &$join_conds, $opts ) { Modified: trunk/WikimediaIncubator.dev-i18n.php =================================================================== --- trunk/WikimediaIncubator.dev-i18n.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/WikimediaIncubator.dev-i18n.php 2011-07-15 21:33:50 UTC (rev 23) @@ -29,9 +29,9 @@ 'wminc-languages-valid' => 'Code validity', 'wminc-languages-projects' => 'Projects', - 'group-test-sysop' => 'Local administrators', - 'group-test-sysop-member' => 'local administrator', - 'grouppage-test-sysop' => 'Project:Local administrators', + 'group-test-sysop' => 'Test wiki administrators', + 'group-test-sysop-member' => 'test wiki administrator', + 'grouppage-test-sysop' => 'Project:Test wiki administrators', ); /** Nederlands (Dutch) Modified: trunk/WikimediaIncubator.i18n.php =================================================================== --- trunk/WikimediaIncubator.i18n.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/WikimediaIncubator.i18n.php 2011-07-15 21:33:50 UTC (rev 23) @@ -241,12 +241,14 @@ 'wminc-prefinfo-code' => 'Код мовы ISO 639', 'wminc-prefinfo-project' => 'Выберыце праект фундацыі «Вікімэдыя» (выберыце варыянт Інкубатар, калі займаецеся агульнай працай)', 'wminc-prefinfo-error' => 'Вы выбралі праект, які патрабуе код мовы.', - 'wminc-warning-unprefixed' => 'Папярэджаньне: старонка, якую Вы рэдагуеце, ня мае прэфікса!', - 'wminc-warning-suggest' => 'Вы можаце стварыць старонку [[:$1]].', - 'wminc-warning-suggest-move' => 'Вы можаце [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} перанесьці гэту старонку ў $1].', + 'wminc-error-move-unprefixed' => 'Памылка: старонка, якую Вы спрабуеце перанесьці [[{{MediaWiki:Helppage}}|ня мае прэфіксу ці мае няслушны прэфікс]]!', + 'wminc-error-wronglangcode' => "'''Памылка:''' старонка, якую Вы спрабуеце рэдагаваць, утрымлівае [[{{MediaWiki:Helppage}}|няслушны код мовы]] «$1»!", + 'wminc-error-unprefixed' => "'''Памылка:''' старонка, якую Вы спрабуеце рэдагаваць, [[{{MediaWiki:Helppage}}|ня мае прэфіксу]]!", + 'wminc-error-unprefixed-suggest' => "'''Памылка:''' Старонка, якую Вы спрабуеце рэдагаваць, [[{{MediaWiki:Helppage}}|не мае прэфіксу]]! Вы можаце стварыць старонку на [[:$1]].", 'right-viewuserlang' => 'прагляд [[Special:ViewUserLang|мовы ўдзельніка і тэставаньне вікі]]', 'randombytest' => 'Выпадковая старонка тэставай вікі', 'randombytest-nopages' => 'Няма старонак ў Вашай тэставай вікі, у прасторы назваў: $1.', + 'wminc-recentchanges-all' => 'Усе апошнія зьмены', ); /** Bulgarian (Български) @@ -1292,10 +1294,7 @@ 'wminc-prefinfo-code' => 'Kod bahasa ISO 639', 'wminc-prefinfo-project' => 'Pilih projek Wikimedia (pilihan Incubator ialah bagi pengguna yang membuat kerja umum)', 'wminc-prefinfo-error' => 'Anda memilih projek yang memerlukan kod bahasa.', - 'wminc-warning-unprefixed' => "'''Amaran:''' Laman yang anda sunting tiada awalan!", - 'wminc-warning-suggest' => 'Anda boleh cipta satu laman di [[:$1]].', - 'wminc-warning-suggest-move' => 'Anda boleh [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} alih laman ini ke $1].', - 'right-viewuserlang' => 'Lihat [[Special:ViewUserLang|bahasa pengguna dan wiki ujian]]', + 'right-viewuserlang' => 'Melihat [[Special:ViewUserLang|bahasa pengguna dan wiki ujian]]', 'randombytest' => 'Laman rawak oleh wiki ujian', 'randombytest-nopages' => 'Tidak terdapat laman dalam wiki ujian anda, dalam ruang nama: $1.', ); Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-07-15 19:31:17 UTC (rev 22) +++ trunk/WikimediaIncubator.php 2011-07-15 21:33:50 UTC (rev 23) @@ -7,12 +7,14 @@ * * @file * @ingroup Extensions + * @author Robin Pepermans (SPQRobin) + * @author Hydriz */ $wgExtensionCredits['other'][] = array( 'path' => __FILE__, 'name' => 'Wikimedia Incubator', - 'author' => array('SPQRobin', 'Hydriz'), + 'author' => array( 'SPQRobin', 'Hydriz' ), 'version' => 'dev, synced to 3.1.1 in svn', 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator', 'descriptionmsg' => 'wminc-desc', @@ -105,6 +107,9 @@ /* ==================== BEGIN OF STUFF IN DEVELOPMENT ================ */ +/* Get the big $wmincLanguageCodes array which can be updated through the generateCodeList.php script */ +require_once( 'codelist.php' ); + /* support for automatic checking in a list of databases if a wiki exists */ $wmincExistingWikis = $wgLocalDatabases; /* Stupid "wiki" referring to "wikipedia" in WMF config */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-07-14 21:46:14
|
Revision: 21 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=21&view=rev Author: robin-p Date: 2011-07-14 21:46:08 +0000 (Thu, 14 Jul 2011) Log Message: ----------- IE fix Modified Paths: -------------- trunk/InfoPage.php Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-07-14 21:33:09 UTC (rev 20) +++ trunk/InfoPage.php 2011-07-14 21:46:08 UTC (rev 21) @@ -61,7 +61,7 @@ $thumb = $imageobj->transform( array( 'width' => $width ) ); $logo = '<img src="' . $thumb->getUrl() . '" title="'.$project.'" alt="'.$project. - '" width="'.$width.'" height="'.$height.'" '.$args.' />'; + '" width="'.$width.'"'.($height ? ' height="'.$height.'"' : '').' '.$args.' />'; } else { $logo = $project; # image not found } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-07-14 21:33:20
|
Revision: 20 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=20&view=rev Author: robin-p Date: 2011-07-14 21:33:09 +0000 (Thu, 14 Jul 2011) Log Message: ----------- distinction existing <> other Modified Paths: -------------- trunk/InfoPage.i18n.php trunk/InfoPage.php Modified: trunk/InfoPage.i18n.php =================================================================== --- trunk/InfoPage.i18n.php 2011-07-14 21:26:43 UTC (rev 19) +++ trunk/InfoPage.i18n.php 2011-07-14 21:33:09 UTC (rev 20) @@ -34,8 +34,9 @@ 'wminc-infopage-missingwiki-text' => 'A $1 in this language does not yet exist.', 'wminc-infopage-option-startwiki' => 'If you want to start this wiki, you can [{{fullurl:{{FULLPAGENAME}}|createmainpage=yes}} create the page] and follow [[{{MediaWiki:Wminc-manual-url}}|our manual]].', - 'wminc-infopage-option-languages' => 'You can search for [http://www.$1.org existing language editions of $1].', - 'wminc-infopage-option-sisterprojects' => 'You can search for existing projects in this language:', + 'wminc-infopage-option-languages-existing' => 'You can search for [http://www.$1.org existing language editions of $1].', + 'wminc-infopage-option-sisterprojects-existing' => 'You can search for existing projects in this language:', + 'wminc-infopage-option-sisterprojects-other' => 'You can search for other projects in this language:', 'wminc-infopage-option-multilingual' => 'You can go to a multilingual wiki:', 'wminc-infopage-createmainpage' => 'Enter the word "Main Page" in this language:', 'wminc-infopage-prefill' => '{{#infopage:open}}', # need to improve this! Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-07-14 21:26:43 UTC (rev 19) +++ trunk/InfoPage.php 2011-07-14 21:33:09 UTC (rev 20) @@ -153,8 +153,8 @@ Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-startwiki', $this->mProjectName ) . # TODO: create main page feature ( $wgRequest->getVal( 'createmainpage' ) ? '<br />' . $this->CreateMainPage() : '') ) . - Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-languages', $this->mProjectName ) ) . - Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-sisterprojects' ) . + Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-languages-existing', $this->mProjectName ) ) . + Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-sisterprojects-existing' ) . $this->listOtherProjects() ) . Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-multilingual' ) . $this->listMultilingualProjects() ) @@ -196,7 +196,7 @@ array( 'class' => 'wminc-infopage-status' ), wfMsg( 'wminc-infopage-status-' . $status, $subdomainLink ) ) . Html::rawElement( 'ul', array( 'class' => 'wminc-infopage-options' ), - Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-sisterprojects' ) . + Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-sisterprojects-other' ) . $this->listOtherProjects() ) . Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-multilingual' ) . $this->listMultilingualProjects() ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-07-14 21:26:54
|
Revision: 19 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=19&view=rev Author: robin-p Date: 2011-07-14 21:26:43 +0000 (Thu, 14 Jul 2011) Log Message: ----------- Basic support for databast list checking: when the wiki exists, the default template is shown accordingly. + further work Modified Paths: -------------- trunk/IncubatorLanguages.php trunk/IncubatorTest.php trunk/InfoPage.css trunk/InfoPage.i18n.php trunk/InfoPage.php trunk/WikimediaIncubator.php Modified: trunk/IncubatorLanguages.php =================================================================== --- trunk/IncubatorLanguages.php 2011-07-14 17:51:12 UTC (rev 18) +++ trunk/IncubatorLanguages.php 2011-07-14 21:26:43 UTC (rev 19) @@ -74,7 +74,7 @@ return $cachedData; } - $msg = wfMessage( strtolower( $wmincProjectSite['name'] . '-codes' ) )->inContentLanguage()->plain(); + $msg = wfMsgForContentNoTrans( strtolower( $wmincProjectSite['name'] . '-codes' ) ); $lines = preg_split( '#\n(?!s)#' , $msg ); if( !is_array( $lines ) ) { return array(); Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-07-14 17:51:12 UTC (rev 18) +++ trunk/IncubatorTest.php 2011-07-14 21:26:43 UTC (rev 19) @@ -277,12 +277,60 @@ // ########### START DEVELOPMENT STUFF ############# /** + * Do we know the databases of the existing wikis? + * @return Boolean + */ + static function canWeCheckDB() { + global $wmincExistingWikis, $wmincProjectDatabases; + if( !is_array( $wmincProjectDatabases ) ) { + return false; # We don't know the database names of the projects + } elseif( !isset( $wmincExistingWikis ) || !is_array( $wmincExistingWikis ) ) { + return false; # No list of databases + } + return true; # Should work now + } + + /** + * Given an incubator testwiki prefix, get the database name of the + * corresponding wiki, whether it exists or not + * @param $prefix Array from IncubatorTest::analyzePrefix(); + * @return false or string + */ + static function getDB( $prefix ) { + if( !self::canWeCheckDB() ) { + return false; + } elseif( isset( $prefix['error'] ) ) { + return false; # shouldn't be, but you never know + } + global $wmincProjectDatabases; + return $prefix['lang'] . $wmincProjectDatabases[$prefix['project']]; + } + + /** + * @param $prefix Array from IncubatorTest::analyzePrefix(); + * @return false or string 'existing' 'closed' 'missing' + */ + static function getDBState( $prefix ) { + $db = self::getDB( $prefix ); + if( !$db ) { + return false; + } + global $wmincExistingWikis, $wmincClosedWikis; + if( !in_array( $db, $wmincExistingWikis ) ) { + return 'missing'; # not in the list + } elseif( is_array( $wmincClosedWikis ) && in_array( $db, $wmincClosedWikis ) ) { + return 'closed'; # in the list of closed wikis + } + return 'existing'; + } + + /** * Make the page content language depend on the test wiki * Only works for codes that are known to MediaWiki :( */ static function onPageContentLanguage( $title, &$pageLang ) { global $wmincTestWikiNamespaces; - $prefix = IncubatorTest::analyzePrefix( $title, + $prefix = self::analyzePrefix( $title, /* onlyInfoPage*/ false, /* noInfoPage */ true ); if( isset( $prefix['error'] ) || !in_array( $title->getNamespace(), $wmincTestWikiNamespaces ) ) { @@ -300,13 +348,18 @@ */ static function onShowMissingArticle( $article ) { $titleObject = $article->mTitle; - $prefix = IncubatorTest::analyzePrefix( $titleObject, true ); + $prefix = self::analyzePrefix( $titleObject, true ); if( isset( $prefix['error'] ) ) { return true; } $infopage = new InfoPage( $titleObject, $prefix ); global $wgOut; - $wgOut->addHtml( $infopage->showMissingWiki() ); + if( self::getDBState( $prefix ) == 'existing' ) { + $infopage->mStatus = 'beforeincubator'; + $wgOut->addHtml( $infopage->showExistingWiki() ); + } else { + $wgOut->addHtml( $infopage->showMissingWiki() ); + } return true; } Modified: trunk/InfoPage.css =================================================================== --- trunk/InfoPage.css 2011-07-14 17:51:12 UTC (rev 18) +++ trunk/InfoPage.css 2011-07-14 21:26:43 UTC (rev 19) @@ -16,11 +16,13 @@ } .wminc-infopage p { margin: .2em 0 .3em; } .wminc-infopage li { padding:.2em 0 .3em; } -.wminc-infopage-missingwiki-welcome { font-style: italic; } +.wminc-infopage-welcome { font-style: italic; } ul.wminc-infopage-otherprojects, ul.wminc-infopage-multilingualprojects { list-style: none; } .wminc-infopage-otherprojects li, .wminc-infopage-multilingualprojects li { display: inline; padding:.5em; } -.wminc-infopage-title { font-size:140%; padding:.3em 0; font-weight:bold; } +.wminc-infopage-title { font-size:145%; padding:.3em 0; font-weight:bold; } .wminc-infopage-text { font-size: 125%; } -.wminc-infopage-missingwiki-options { padding: .2em; } +.wminc-infopage-options { padding: .2em; } .wminc-infopage-logo { float: right; } .wminc-infopage-createmainpage { margin-left: .5em; font-weight: bold; } +.wminc-infopage-status { margin: 1em; } +#ca-nstab-main a { color: black; } \ No newline at end of file Modified: trunk/InfoPage.i18n.php =================================================================== --- trunk/InfoPage.i18n.php 2011-07-14 17:51:12 UTC (rev 18) +++ trunk/InfoPage.i18n.php 2011-07-14 21:26:43 UTC (rev 19) @@ -29,16 +29,24 @@ 'wminc-logo-mediawiki' => 'MediaWiki.svg', 'wminc-manual-url' => 'Help:Manual', # only translate if necessary 'wminc-infopage-title' => '$1 $2', # only translate if necessary - 'wminc-infopage-missingwiki-welcome' => 'Welcome to the Wikimedia Incubator, a project of the Wikimedia Foundation ([[{{MediaWiki:Aboutpage}}|About]])', + 'wminc-infopage-welcome' => 'Welcome to the Wikimedia Incubator, a project of the Wikimedia Foundation ([[{{MediaWiki:Aboutpage}}|About]])', + 'wminc-infopage-missingwiki-text' => 'A $1 in this language does not yet exist.', - 'wminc-infopage-missingwiki-options' => ' -* If you want to start this wiki, you can [{{fullurl:{{FULLPAGENAME}}|createmainpage=yes}} create the page] and follow [[{{MediaWiki:Wminc-manual-url}}|our manual]]. $3 -* You can search for [http://www.$1.org existing language editions of $1]. -* You can search for existing projects in this language: $4 -* You can go to a multilingual wiki: $5', + 'wminc-infopage-option-startwiki' => 'If you want to start this wiki, +you can [{{fullurl:{{FULLPAGENAME}}|createmainpage=yes}} create the page] and follow [[{{MediaWiki:Wminc-manual-url}}|our manual]].', + 'wminc-infopage-option-languages' => 'You can search for [http://www.$1.org existing language editions of $1].', + 'wminc-infopage-option-sisterprojects' => 'You can search for existing projects in this language:', + 'wminc-infopage-option-multilingual' => 'You can go to a multilingual wiki:', 'wminc-infopage-createmainpage' => 'Enter the word "Main Page" in this language:', 'wminc-infopage-prefill' => '{{#infopage:open}}', # need to improve this! 'wminc-infopage-contribute' => 'If you know this language, you are encouraged to contribute!', + + 'wminc-infopage-status-open' => 'This is a new Incubator wiki that is not yet verified by the language committee.', + 'wminc-infopage-status-eligible' => 'This Incubator wiki has been marked as eligible by the language committee.', + 'wminc-infopage-status-imported' => 'This Incubator wiki has been imported from xyz.wikiproject.org after that wiki was closed.', + 'wminc-infopage-status-approved' => 'This Incubator wiki has been approved by the language committee and will soon be created.', + 'wminc-infopage-status-created' => 'This project has been approved by the language committee and is now available at $1.', + 'wminc-infopage-status-beforeincubator' => 'This project was created before Wikimedia Incubator started and is available at $1.', ); /** German (Deutsch) Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-07-14 17:51:12 UTC (rev 18) +++ trunk/InfoPage.php 2011-07-14 21:26:43 UTC (rev 19) @@ -7,7 +7,7 @@ 'eligible': This Incubator wiki has been marked as eligible by the language committee. 'imported': This Incubator wiki has been imported from xyz.wikiproject.org after that wiki was closed. 'approved': This Incubator wiki has been approved by the language committee and will soon be created. -'subdomain' showExistingWiki() +'existing' showExistingWiki() 'created': This project has been approved by the language committee and is now available at xyz.wikiproject.org. 'beforeincubator': This project was created before Wikimedia Incubator started and is available at xyz.wikiproject.org. */ @@ -17,16 +17,12 @@ if( isset( $prefixdata['error'] ) || $title->getNamespace() != NS_MAIN ) { return; } - global $wgRequest, $wmincScriptDir, $wmincProjects; + global $wmincProjects; $this->mPrefix = $prefixdata['prefix']; $this->mLangCode = $prefixdata['lang']; $this->mProjectCode = $prefixdata['project']; $this->mProjectName = isset( $wmincProjects[$this->mProjectCode] ) ? $wmincProjects[$this->mProjectCode] : ''; - # Redirect to real main page if URL is Wx/xxx?goto=mainpage - if( $wgRequest->getVal('goto') == 'mainpage' ) { - $this->redirectToMainPage(); - } $this->mLangNames = IncubatorLanguages::getLanguageNames(); $this->mLangsData = IncubatorLanguages::loadLanguagesData(); $this->mThisLangData = ( isset( $this->mLangsData[$this->mLangCode] ) ? @@ -41,11 +37,10 @@ * In the second case, it adds &redirectfrom and &uselang=xx if set */ public function redirectToMainPage() { - # need to find a proper way - if( isset( $this->mSubdomain ) && $this->mSubdomain == true ) { - header( 'Location: ' . $this->getMainPage() ); + global $wgOut, $wgRequest; + if( in_array( $this->mStatus, array( 'created', 'beforeincubator' ) ) ) { + $url = $this->getSubdomain(); } else { - global $wgOut, $wgRequest; $params = 'redirectfrom=infopage'; $uselang = $wgRequest->getVal( 'uselang' ); if( $uselang ) { @@ -53,16 +48,15 @@ } $mainpage = Title::newFromText( $this->getMainPage() ); $url = $mainpage->getFullURL( $params ); - $wgOut->redirect( $url ); } + $wgOut->redirect( $url ); return; } # Small convenience function to display a (clickable) logo public function makeLogo( $project, $clickable = true, $width = 25, $height = '', $url = '', $args = '' ) { $projectForFile = preg_replace('/ /', '-', strtolower( $project ) ); - # TEMPORARILY TO REDUCE PAGE LOAD - $imageobj = '';/*wfFindFile( wfMsg( 'wminc-logo-' . $projectForFile ) );*/ + $imageobj = wfFindFile( wfMsg( 'wminc-logo-' . $projectForFile ) ); if ( $imageobj ) { $thumb = $imageobj->transform( array( 'width' => $width ) ); $logo = '<img src="' . $thumb->getUrl() . @@ -127,8 +121,17 @@ ); } + public function showWelcome() { + return Html::rawElement( 'div', array( 'class' => 'wminc-infopage-welcome' ), + wfMsgWikiHtml( 'wminc-infopage-welcome' ) ); + } + public function StandardInfoPage( $beforetitle, $aftertitle, $content ) { - global $wgLang, $wgOut, $wmincScriptDir; + global $wgRequest, $wgLang, $wgOut, $wmincScriptDir; + # Redirect to real main page if URL is Wx/xxx?goto=mainpage + if( $wgRequest->getVal('goto') == 'mainpage' ) { + $this->redirectToMainPage(); + } $wgOut->addModules( 'WikimediaIncubator.InfoPage' ); return Html::rawElement( 'div', array( 'class' => 'wminc-infopage plainlinks', 'lang' => $wgLang->getCode(), 'dir' => $wgLang->getDir() ), @@ -144,22 +147,24 @@ public function showMissingWiki() { global $wgRequest; - $welcome = Html::rawElement( 'div', array( 'class' => 'wminc-infopage-missingwiki-welcome' ), - wfMsgWikiHtml( 'wminc-infopage-missingwiki-welcome' ) ); - $content = Html::rawElement( 'div', array( 'class' => 'wminc-infopage-missingwiki-text' ), + $content = Html::rawElement( 'div', array( 'class' => 'wminc-infopage-status' ), wfMsgWikiHtml( 'wminc-infopage-missingwiki-text', $this->mProjectName, $this->mLangName ) ) . - Html::rawElement( 'ul', array( 'class' => 'wminc-infopage-missingwiki-options' ), - wfMsgWikiHtml( 'wminc-infopage-missingwiki-options', $this->mProjectName, - $this->mLangName, ( $wgRequest->getVal( 'createmainpage' ) ? - '<br />' . $this->CreateMainPage() : ''), - $this->listOtherProjects(), $this->listMultilingualProjects() ) + Html::rawElement( 'ul', array( 'class' => 'wminc-infopage-options' ), + Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-startwiki', $this->mProjectName ) . + # TODO: create main page feature + ( $wgRequest->getVal( 'createmainpage' ) ? '<br />' . $this->CreateMainPage() : '') ) . + Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-languages', $this->mProjectName ) ) . + Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-sisterprojects' ) . + $this->listOtherProjects() ) . + Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-multilingual' ) . + $this->listMultilingualProjects() ) ); - return $this->StandardInfoPage( $welcome, '', $content ); + return $this->StandardInfoPage( $this->showWelcome(), '', $content ); } public function showIncubatingWiki() { global $wgUser; - $status = $this->mStatus; + $status = isset( $this->mStatus ) ? $this->mStatus : ''; $bug = isset( $this->mBug ) ? $this->mBug : ''; if( $this->mThisLangData['type'] != 'invalid' ) { $gotoMainPage = Html::rawElement( 'span', @@ -177,21 +182,25 @@ } public function showExistingWiki() { + global $wgLang; $created = isset( $this->mCreated ) ? $this->mCreated : ''; - $status = $this->mStatus; + $status = isset( $this->mStatus ) ? $this->mStatus : ''; $bug = isset( $this->mBug ) ? $this->mBug : ''; + $subdomainLink = Linker::makeExternalLink( $this->getSubdomain(), $this->getSubdomain() ); if( $this->mThisLangData['type'] != 'invalid' ) { $gotoSubdomain = Html::rawElement( 'span', array( 'class' => 'wminc-infopage-entertest' ), - '→ <a href="' . $this->getSubdomain() . '">' - . $this->getSubdomain( '', false ). '</a>' ); + $wgLang->getArrow() . ' ' . $subdomainLink ); } - $content = ''; - $content .= Html::element( 'div', array( 'class' => 'wminc-infopage-status' ), wfMsg( 'wminc-infopage-status-' . $status ) ); - if( $status != 'approved' && $this->mThisLangData['type'] != 'invalid' ) { - $content .= Html::element( 'div', array( 'class' => 'wminc-infopage-contribute' ), wfMsg( 'wminc-infopage-contribute' ) ); - } - $content .= wfMsg( 'wminc-infopage-text-' . $status, array( $status, 'Lol!', '', $bug ) ); - return $this->StandardInfoPage( '', $gotoSubdomain, $content ); + $content = Html::rawElement( 'div', + array( 'class' => 'wminc-infopage-status' ), + wfMsg( 'wminc-infopage-status-' . $status, $subdomainLink ) + ) . Html::rawElement( 'ul', array( 'class' => 'wminc-infopage-options' ), + Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-sisterprojects' ) . + $this->listOtherProjects() ) . + Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-multilingual' ) . + $this->listMultilingualProjects() ) + ); + return $this->StandardInfoPage( $this->showWelcome(), $gotoSubdomain, $content ); } } \ No newline at end of file Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-07-14 17:51:12 UTC (rev 18) +++ trunk/WikimediaIncubator.php 2011-07-14 21:26:43 UTC (rev 19) @@ -105,6 +105,22 @@ /* ==================== BEGIN OF STUFF IN DEVELOPMENT ================ */ +/* support for automatic checking in a list of databases if a wiki exists */ +$wmincExistingWikis = $wgLocalDatabases; +/* Stupid "wiki" referring to "wikipedia" in WMF config */ +$wmincProjectDatabases = array( + 'p' => 'wiki', + 'b' => 'wikibooks', + 't' => 'wiktionary', + 'q' => 'wikiquote', + 'n' => 'wikinews', + 's' => 'wikisource', + 'v' => 'wikiversity', +); +# if WMF/SiteMatrix config is available, use if +# NOTICE: include SiteMatrix extension before this extension (this is the case for WMF) +$wmincClosedWikis = isset( $wgSiteMatrixClosedSites ) ? $wgSiteMatrixClosedSites : array(); + /* Messages not in SVN */ $wgExtensionMessagesFiles['WikimediaIncubator-dev'] = $dir . 'WikimediaIncubator.dev-i18n.php'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-07-14 17:51:19
|
Revision: 18 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=18&view=rev Author: robin-p Date: 2011-07-14 17:51:12 +0000 (Thu, 14 Jul 2011) Log Message: ----------- - Delete files after renaming them - Add msgs Modified Paths: -------------- trunk/WikimediaIncubator.dev-i18n.php Removed Paths: ------------- trunk/SpecialLanguages (save).php trunk/SpecialLanguages (uc).php Deleted: trunk/SpecialLanguages (save).php =================================================================== --- trunk/SpecialLanguages (save).php 2011-07-12 00:40:58 UTC (rev 17) +++ trunk/SpecialLanguages (save).php 2011-07-14 17:51:12 UTC (rev 18) @@ -1,317 +0,0 @@ -<?php -$wgSpecialPages['Interwiki'] = 'SpecialInterwiki'; -$wgSpecialPageGroups['Interwiki'] = 'wiki'; -$wgAutoloadClasses['SpecialInterwiki'] = $dir . 'SpecialInterwiki_body.php'; - -$wgAvailableRights[] = 'interwiki'; - -$wgLogTypes[] = 'interwiki'; -$wgLogNames['interwiki'] = 'interwiki_logpagename'; -$wgLogHeaders['interwiki'] = 'interwiki_logpagetext'; -$wgLogActions['interwiki/interwiki'] = 'interwiki_logentry'; -$wgLogActions['interwiki/iw_add'] = 'interwiki_log_added'; -$wgLogActions['interwiki/iw_delete'] = 'interwiki_log_deleted'; -$wgLogActions['interwiki/iw_edit'] = 'interwiki_log_edited'; - -/** - * implements Special:Interwiki - * @ingroup SpecialPage - */ -class SpecialInterwiki extends SpecialPage { - function __construct() { - parent::__construct( 'Interwiki' ); - } - - function execute( $par ) { - global $wgRequest, $wgOut, $wgUser; - - wfLoadExtensionMessages( 'Interwiki' ); - - $admin = $wgUser->isAllowed( 'interwiki' ); - - $this->setHeaders(); - $this->outputHeader(); - - $admin = $wgUser->isAllowed( 'interwiki' ); - if ( $admin ) { - $wgOut->setPagetitle( wfMsg( 'interwiki' ) ); - } else { - $wgOut->setPagetitle( wfMsg( 'interwiki-title-norights' ) ); - } - $action = $wgRequest->getVal( 'action', $par ); - - switch( $action ){ - case "delete": - case "edit" : - case "add" : - if( !$admin ){ - $wgOut->permissionRequired('interwiki'); - return; - } - $this->showForm( $action ); - break; - case "submit": - if( !$admin ){ - $wgOut->permissionRequired( 'interwiki' ); - return; - } - if( !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { - $wgOut->addWikiMsg( 'sessionfailure' ); - return; - } - $this->doSubmit(); - break; - default: - $this->showList( $admin ); - break; - } - } - - function showForm( $action ) { - global $wgRequest, $wgUser, $wgOut; - - $actionUrl = $this->getTitle()->getLocalURL( 'action=submit' ); - $token = $wgUser->editToken(); - $defaultreason = $wgRequest->getVal( 'wpInterwikiReason', wfMsgForContent( 'interwiki_defaultreason' ) ); - - switch( $action ){ - case "delete": - - $prefix = $wgRequest->getVal( 'prefix' ); - $button = wfMsg( 'delete' ); - $topmessage = wfMsg( 'interwiki_delquestion', $prefix ); - $deletingmessage = wfMsgExt( 'interwiki_deleting', array( 'parseinline' ), $prefix ); - $reasonmessage = wfMsg( 'deletecomment' ); - - $wgOut->addHTML( - Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', null, $topmessage ) . - Xml::openElement( 'form', array('id'=> 'mw-interwiki-deleteform', 'method'=> 'post', 'action' => $actionUrl ) ) . - Xml::openElement( 'table' ) . - "<tr><td>$deletingmessage</td></tr>". - '<tr><td class="mw-label">' . Xml::label( $reasonmessage, 'mw-interwiki-deletereason') . '</td>' . - '<td class="mw-input">' . - Xml::input( 'wpInterwikiReason', 60, $defaultreason, array( 'tabindex' => '1', 'id' => 'mw-interwiki-deletereason', 'maxlength' => '200' ) ) . - '</td></tr>' . - '<tr><td class="mw-submit">' . Xml::submitButton( $button, array( 'id' => 'mw-interwiki-submit' ) ) . - Xml::hidden( 'wpInterwikiPrefix', $prefix ) . - Xml::hidden( 'wpInterwikiAction', $action ) . - Xml::hidden( 'wpEditToken', $token ) . - '</td></tr>' . - Xml::closeElement( 'table' ) . - Xml::closeElement( 'form' ) . - Xml::closeElement( 'fieldset' ) - ); - break; - case "edit" : - case "add" : - if( $action == "edit" ){ - $prefix = $wgRequest->getVal( 'prefix' ); - $dbr = wfGetDB( DB_SLAVE ); - $row = $dbr->selectRow( 'interwiki', '*', array( 'iw_prefix' => $prefix ) ); - if( !$row ){ - $this->error( 'interwiki_editerror', $prefix ); - return; - } - $prefix = '<tt>' . htmlspecialchars( $row->iw_prefix ) . '</tt>'; - $defaulturl = $row->iw_url; - $trans = $row->iw_trans; - $local = $row->iw_local; - $old = Xml::hidden( 'wpInterwikiPrefix', $row->iw_prefix ); - $topmessage = wfMsgExt( 'interwiki_edittext', array( 'parseinline' ) ); - $intromessage = wfMsgExt( 'interwiki_editintro', array( 'parseinline' ) ); - $button = wfMsg( 'edit' ); - } else { - $prefix = $wgRequest->getVal( 'wpInterwikiPrefix' ) ? $wgRequest->getVal( 'wpInterwikiPrefix' ) : $wgRequest->getVal( 'prefix' ); - $prefix = Xml::input( 'wpInterwikiPrefix', 20, $prefix, array( 'tabindex'=>'1', 'id'=>'mw-interwiki-prefix', 'maxlength'=>'20' ) ); - $local = $wgRequest->getCheck( 'wpInterwikiLocal' ); - $trans = $wgRequest->getCheck( 'wpInterwikiTrans' ); - $old = ''; - $defaulturl = $wgRequest->getVal( 'wpInterwikiURL' ) ? $wgRequest->getVal( 'wpInterwikiURL' ) : wfMsg( 'interwiki_defaulturl' ); - $topmessage = wfMsgExt( 'interwiki_addtext', array( 'parseinline' ) ); - $intromessage = wfMsgExt( 'interwiki_addintro', array( 'parseinline' ) ); - $button = wfMsg( 'interwiki_addbutton' ); - } - - $prefixmessage = wfMsgHtml( 'interwiki_prefix' ); - $localmessage = wfMsg( 'interwiki_local' ); - $transmessage = wfMsg( 'interwiki_trans' ); - $reasonmessage = wfMsg( 'interwiki_reasonfield' ); - $urlmessage = wfMsg( 'interwiki_url' ); - - $wgOut->addHTML( - Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', null, $topmessage ) . - $intromessage . - Xml::openElement( 'form', array('id'=> 'mw-interwiki-editform', 'method'=> 'post', 'action'=>$actionUrl) ) . - Xml::openElement( 'table', array('id'=>"mw-interwiki-$action") ) . - "<tr><td class='mw-label'>$prefixmessage</td><td><tt>$prefix</tt></td></tr>" . - "<tr><td class='mw-label'>" . Xml::label( $localmessage, 'mw-interwiki-local' ) . '</td>' . - "<td class='mw-input'>" . Xml::check( 'wpInterwikiLocal', $local, array('id'=>'mw-interwiki-local') ) . '</td></tr>' . - '<tr><td class="mw-label">' . Xml::label( $transmessage, 'mw-interwiki-trans' ) . '</td>' . - '<td class="mw-input">' . Xml::check( 'wpInterwikiTrans', $trans, array('id'=>'mw-interwiki-trans') ) . '</td></tr>' . - '<tr><td class="mw-label">' . Xml::label( $urlmessage, 'mw-interwiki-url' ) . '</td>' . - '<td class="mw-input">' . Xml::input( 'wpInterwikiURL', 60, $defaulturl, array('tabindex'=>'1', 'maxlength'=>'200', 'id'=>'mw-interwiki-url') ) . '</td></tr>' . - '<tr><td class="mw-label">' . Xml::label( $reasonmessage, 'mw-interwiki-editreason' ) . '</td>' . - '<td class="mw-input">' . Xml::input( 'wpInterwikiReason', 60, $defaultreason, array( 'tabindex'=>'1', 'id'=>'mw-interwiki-editreason', 'maxlength'=>'200') ) . - Xml::hidden( 'wpInterwikiAction', $action ) . - $old . - Xml::hidden( 'wpEditToken', $token ) . - '</td></tr>' . - '<tr><td class="mw-submit">' . Xml::submitButton( $button, array( 'id'=>'mw-interwiki-submit' ) ) . '</td></tr>' . - Xml::closeElement( 'table' ) . - Xml::closeElement( 'form' ) . - Xml::closeElement( 'fieldset' ) - ); - break; - } - } - - function doSubmit() { - global $wgRequest, $wgOut; - $prefix = $wgRequest->getVal( 'wpInterwikiPrefix' ); - $do = $wgRequest->getVal( 'wpInterwikiAction' ); - if( preg_match( '/[\s:&=]/', $prefix ) ) { - $this->error( 'interwiki-badprefix', htmlspecialchars( $prefix ) ); - $this->showForm( $do ); - return; - } - $reason = $wgRequest->getText( 'wpInterwikiReason' ); - $selfTitle = $this->getTitle(); - $dbw = wfGetDB( DB_MASTER ); - switch( $do ){ - case "delete": - $dbw->delete( 'interwiki', array( 'iw_prefix' => $prefix ), __METHOD__ ); - - if ( $dbw->affectedRows() == 0 ) { - $this->error( 'interwiki_delfailed', $prefix ); - $this->showForm( $do ); - } else { - $wgOut->addWikiText( wfMsg( 'interwiki_deleted', $prefix )); - $wgOut->returnToMain( false, $selfTitle ); - $log = new LogPage( 'interwiki' ); - $log->addEntry( 'iw_delete', $selfTitle, $reason, array( $prefix ) ); - } - break; - case "edit": - case "add": - $theurl = $wgRequest->getVal( 'wpInterwikiURL' ); - $local = $wgRequest->getCheck( 'wpInterwikiLocal' ) ? 1 : 0; - $trans = $wgRequest->getCheck( 'wpInterwikiTrans' ) ? 1 : 0; - $data = array( 'iw_prefix' => $prefix, 'iw_url' => $theurl, - 'iw_local' => $local, 'iw_trans' => $trans ); - - if( $do == 'add' ){ - $dbw->insert( 'interwiki', $data, __METHOD__, 'IGNORE' ); - } else { - $dbw->update( 'interwiki', $data, array( 'iw_prefix' => $prefix ), __METHOD__, 'IGNORE' ); - } - - if( $dbw->affectedRows() == 0 ) { - $this->error( "interwiki_{$do}failed", $prefix ); - $this->showForm( $do ); - } else { - $wgOut->addWikiMsg( "interwiki_{$do}ed", $prefix ); - $wgOut->returnToMain( false, $selfTitle ); - $log = new LogPage( 'interwiki' ); - $log->addEntry( 'iw_'.$do, $selfTitle, $reason, array( $prefix, $theurl, $trans, $local ) ); - } - break; - } - } - - function trans_local( $tl, $msg0, $msg1 ) { - if( $tl==='0' ) - return $msg0; - if( $tl==='1' ) - return $msg1; - return htmlspecialchars( $tl ); - } - - function showList( $admin ) { - global $wgUser, $wgOut, $wgScriptPath; - - $wgOut->addExtensionStyle( "{$wgScriptPath}/extensions/Interwiki/SpecialInterwiki.css" ); - - $prefixmessage = wfMsgHtml( 'interwiki_prefix' ); - $urlmessage = wfMsgHtml( 'interwiki_url' ); - $localmessage = wfMsgHtml( 'interwiki_local' ); - $transmessage = wfMsgHtml( 'interwiki_trans' ); - $message_0 = wfMsgHtml( 'interwiki_0' ); - $message_1 = wfMsgHtml( 'interwiki_1' ); - - $out = ' -<table width="100%" cellspacing="0" cellpadding="0" border="0" style="border:0" class="mw-interwikitable wikitable intro"> -<tr><th class="mw-align-left">' . $prefixmessage . '</th><td>' . wfMsgExt( 'interwiki_prefix_intro', 'parseinline' ) . '</td></tr> -<tr><th class="mw-align-left">' . $urlmessage . '</th><td>' . wfMsgExt( 'interwiki_url_intro', 'parseinline' ) . '</td></tr> -<tr><th class="mw-align-left">' . $localmessage . '</th><td>' . wfMsgExt( 'interwiki_local_intro', 'parseinline' ) . '</td></tr> -<tr><th class="mw-align-right">' . $message_0 . '</th><td>' . wfMsgExt( 'interwiki_local_0_intro', 'parseinline' ) . '</td></tr> -<tr><th class="mw-align-right">' . $message_1 . '</th><td>' . wfMsgExt( 'interwiki_local_1_intro', 'parseinline' ) . '</td></tr> -<tr><th class="mw-align-left">' . $transmessage . '</th><td>' . wfMsgExt( 'interwiki_trans_intro', 'parseinline' ) . '</td></tr> -<tr><th class="mw-align-right">' . $message_1 . '</th><td>' . wfMsgExt( 'interwiki_trans_1_intro', 'parseinline' ) . '</td></tr> -<tr><th class="mw-align-right">' . $message_0 . '</th><td>' . wfMsgExt( 'interwiki_trans_0_intro', 'parseinline' ) . '</td></tr> -</table> -'; - $wgOut->addWikiMsg( 'interwiki_intro' ); - $wgOut->addHTML( $out ); - $wgOut->addWikiMsg( 'interwiki_intro_footer' ); - $selfTitle = $this->getTitle(); - - if ( $admin ) { - $skin = $wgUser->getSkin(); - $addtext = wfMsgHtml( 'interwiki_addtext' ); - $addlink = $skin->link( $selfTitle, $addtext, array(), array( 'action' => 'add' ) ); - $wgOut->addHTML( '<p>' . $addlink . '</p>' ); - } - - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'interwiki', '*' ); - $numrows = $res->numRows(); - if ( $numrows == 0 ) { - $this->error( 'interwiki_error' ); - return; - } - - $out = " - <table width='100%' class='mw-interwikitable wikitable body'> - <tr id='interwikitable-header'><th>$prefixmessage</th> <th>$urlmessage</th> <th>$localmessage</th> <th>$transmessage</th>"; - if( $admin ) { - $deletemessage = wfMsgHtml( 'delete' ); - $editmessage = wfMsgHtml( 'edit' ); - $out .= '<th>'.wfMsgHtml( 'interwiki_edit' ).'</th>'; - } - $out .= "</tr>\n"; - - while( $s = $res->fetchObject() ) { - $prefix = htmlspecialchars( $s->iw_prefix ); - $url = htmlspecialchars( $s->iw_url ); - $trans = $this->trans_local( $s->iw_trans, $message_0, $message_1 ); - $local = $this->trans_local( $s->iw_local, $message_0, $message_1 ); - $out .= "<tr class='mw-interwikitable-row'> - <td class='mw-interwikitable-prefix'>$prefix</td> - <td class='mw-interwikitable-url'>$url</td> - <td class='mw-interwikitable-local'>$local</td> - <td class='mw-interwikitable-trans'>$trans</td>"; - if( $admin ) { - $out .= '<td class="mw-interwikitable-modify">'; - $out .= $skin->link( $selfTitle, $editmessage, array(), - array( 'action' => 'edit', 'prefix' => $s->iw_prefix ) ); - $out .= ', '; - $out .= $skin->link( $selfTitle, $deletemessage, array(), - array( 'action' => 'delete', 'prefix' => $s->iw_prefix ) ); - $out .= '</td>'; - } - - $out .= "\n</tr>\n"; - } - $res->free(); - $out .= "</table><br />"; - $wgOut->addHTML( $out ); - } - - function error() { - global $wgOut; - $args = func_get_args(); - $wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args ); - } -} Deleted: trunk/SpecialLanguages (uc).php =================================================================== --- trunk/SpecialLanguages (uc).php 2011-07-12 00:40:58 UTC (rev 17) +++ trunk/SpecialLanguages (uc).php 2011-07-14 17:51:12 UTC (rev 18) @@ -1,354 +0,0 @@ -<?php -$wgSpecialPages['Languages'] = 'SpecialLanguages'; -$wgSpecialPageGroups['Languages'] = 'wiki'; - -$wgAvailableRights[] = 'editlangs'; -$wgGroupPermissions['sysop']['editlangs'] = true; - -$wgLogTypes[] = 'languages'; -$wgLogNames['languages'] = 'wminc-languages-log-name'; -$wgLogHeaders['languages'] = 'wminc-languages-log-text'; -$wgLogActions['languages/languages'] = 'wminc-languages-log-entry'; -$wgLogActions['languages/lang_add'] = 'wminc-languages-log-added'; -$wgLogActions['languages/lang_del'] = 'wminc-languages-log-deleted'; -$wgLogActions['languages/lang_edit'] = 'wminc-languages-log-edited'; - -$wgExtensionMessagesFiles['TestWikiDB'] = $dir . 'TestWikiDB.i18n.php'; - -/** - * implements Special:Languages - * @ingroup SpecialPage - */ -class SpecialLanguages extends SpecialPage { - function __construct() { - parent::__construct( 'Languages' ); - } - - function execute( $par ) { - global $wgRequest, $wgOut, $wgUser; - - wfLoadExtensionMessages( 'TestWikiDB' ); - - $admin = $wgUser->isAllowed( 'editlangs' ); - - $this->setHeaders(); - $this->outputHeader(); - - if ( $admin ) { - $wgOut->setPagetitle( wfMsg( 'wminc-languages' ) ); - } else { - $wgOut->setPagetitle( wfMsg( 'wminc-languages-title-norights' ) ); - } - $action = $wgRequest->getVal( 'action', $par ); - - switch( $action ){ - case "delete": - if($admin) { - $this->DeleteLanguage(); - } else { - $wgOut->permissionRequired('editlangs'); - } - break; - case "edit": - if($admin) { - $this->EditLanguage(); - } else { - $wgOut->permissionRequired('editlangs'); - } - break; - case "add": - if($admin) { - $this->AddLanguage(); - } else { - $wgOut->permissionRequired('editlangs'); - } - break; - case "submit": - if( !$admin ){ - $wgOut->permissionRequired( 'editlangs' ); - return; - } - if( !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { - $wgOut->addWikiMsg( 'sessionfailure' ); - return; - } - $this->doSubmit(); - break; - default: - $this->showList( $admin ); - break; - } - } - - function FormRow( $name, $input ) { - return '<tr>'. - '<td class="mw-label">'.Xml::label( wfMsg( 'wminc-languages-'.$name ), 'mw-languages-'.$name ).'</td>'. - '<td class="mw-input">'.$input.'</td>'. - '</tr>'; - } - - function SelectValidity( $currentvalue ) { - $options = array( - 'tocheck' => 'code has to be checked (default value)', - 'valid' => 'a valid ISO 639 language code', - 'invalid' => 'an invalid ISO 639 language code (i.e. will not be accepted by the langcom)', - 'art' => 'artificial, constructed language', - 'history' => 'not spoken anymore (corresponds to "extinct", "historical" and "ancient" values of SIL)', - 'exists' => 'all WMF projects exist in that language (Wikisource and Wikiversity do not count)', - 'macro' => 'a macrolanguage, as defined by SIL', - 'collect' => 'collection of languages, as defined by SIL', - 'nearext' => 'nearly extinct, a language with very few speakers left', - 'special' => 'other situations', - ); - $out = '<select name="wpLanguagesValid" id="mw-languages-valid">'; - foreach($options as $option => $desc) { - $out .= '<option value="'.$option.'"'; - if($currentvalue == $option) { $out .= ' selected'; } - $out .= '><i>'.$option.'</i> || '.$desc.'</option>'; - } - $out .= '</select>'; - return $out; - } - - function AddLanguage() { - global $wgRequest, $wgUser, $wgOut; - $wgOut->addHTML( - Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', null, wfMsgExt( 'wminc-languages-intro-add', array( 'parseinline' ) ) ) . - Xml::openElement( 'form', array('id'=> 'mw-languages-editform', 'method'=> 'post', 'action'=> $this->getTitle()->getLocalURL( 'action=submit' ) ) ) . - Xml::openElement( 'table', array('id'=>'mw-languages-add') ) . - "\n" . - self::FormRow('code3', Xml::input( 'wpLanguagesCode3', 3, $wgRequest->getVal( 'lang' ), array('id'=>'mw-languages-code3', 'maxlength'=>3) ) ). - self::FormRow('code1', Xml::input( 'wpLanguagesCode1', 2, NULL, array('id'=>'mw-languages-code1', 'maxlength'=>2) ) ). - self::FormRow('name-eng', Xml::input( 'wpLanguagesEng', 60, NULL, array('id'=>'mw-languages-eng') ) ). - self::FormRow('name-native', '<i>Not yet definable</i>' ). - self::FormRow('valid', self::SelectValidity( NULL ) ). - self::FormRow('dir', - Xml::radio( 'wpLanguagesDir', 1, true, array('id'=>'mw-languages-dir') ).'LTR'. - Xml::radio( 'wpLanguagesDir', 0, false, array('id'=>'mw-languages-dir') ).'RTL' - ). - self::FormRow('reason', Xml::input( 'wpLanguagesReason', 60, NULL, array( 'tabindex'=>'1', 'id'=>'mw-languages-reason', 'maxlength'=>'200') ) ). - Xml::hidden( 'wpLanguagesAction', 'add' ) . - Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . - '<tr><td class="mw-submit">' . Xml::submitButton( wfMsg( 'tooltip-save' ), array( 'id'=>'mw-languages-submit' ) ) . '</td></tr>' . - Xml::closeElement( 'table' ) . - Xml::closeElement( 'form' ) . - Xml::closeElement( 'fieldset' ) - ); - } - - function EditLanguage() { - global $wgRequest, $wgUser, $wgOut; - $langcode = $wgRequest->getVal( 'lang' ); - $dbr = wfGetDB( DB_SLAVE ); - $row = $dbr->selectRow( 'inc_langs', '*', array( 'code3' => $langcode ) ); - if( !$row ){ - $this->error( 'languages-editerror', $langcode ); - return; - } - $wgOut->addHTML( - Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', null, wfMsgExt( 'wminc-languages-intro-add', array( 'parseinline' ) ) ) . - Xml::openElement( 'form', array('id'=> 'mw-languages-editform', 'method'=> 'post', 'action'=> $this->getTitle()->getLocalURL( 'action=submit' ) ) ) . - Xml::openElement( 'table', array('id'=>'mw-languages-edit') ) . - "\n" . - self::FormRow('code3', $langcode ). - self::FormRow('code1', Xml::input( 'wpLanguagesCode1', 2, $row->code1, array('id'=>'mw-languages-code1', 'maxlength'=>2) ) ). - self::FormRow('name-eng', Xml::input( 'wpLanguagesEng', 60, $row->eng_name, array('id'=>'mw-languages-eng') ) ). - self::FormRow('name-native', self::EditLanguageNativeName( $langcode, $row->code1, $row ) ). - self::FormRow('valid', self::SelectValidity( $row->valid ) ). - self::FormRow('dir', - Xml::radio( 'wpLanguagesDir', 1, true, array('id'=>'mw-languages-dir') ).'LTR'. - Xml::radio( 'wpLanguagesDir', 0, false, array('id'=>'mw-languages-dir') ).'RTL' - ). - self::FormRow('reason', Xml::input( 'wpLanguagesReason', 60, NULL, array( 'tabindex'=>'1', 'id'=>'mw-languages-reason', 'maxlength'=>'200') ) ). - Xml::hidden( 'wpLanguagesAction', 'edit' ) . - Xml::hidden( 'wplanguagesCode3', $row->code3 ) . - Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . - '<tr><td class="mw-submit">' . Xml::submitButton( wfMsg( 'tooltip-save' ), array( 'id'=>'mw-languages-submit' ) ) . '</td></tr>' . - Xml::closeElement( 'table' ) . - Xml::closeElement( 'form' ) . - Xml::closeElement( 'fieldset' ) - ); - } - - function EditLanguageNativeName( $code3, $code1, $row ) { - // This function displays the native name if it has already been defined in MediaWiki, else it shows an input field to enter one. - global $wgLanguageNames; - if(preg_match('/[a-z][a-z]/', $code1)) { - $langcode = $code1; - } else { - $langcode = $code3; - } - if(isset($wgLanguageNames[$langcode])) { - return '<b>'.$wgLanguageNames[$langcode].'</b>'; - } else { - return Xml::input( 'wpLanguagesNative', 60, $row->native_name, array('id'=>'mw-languages-native') ); - } - } - - function DeleteLanguage() { - global $wgRequest, $wgUser, $wgOut; - $langcode = $wgRequest->getVal( 'lang' ); - $wgOut->addHTML( - Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', null, wfMsg( 'wminc-languages-deleting-title', $langcode ) ) . - Xml::openElement( 'form', array('id'=> 'mw-languages-deleteform', 'method'=> 'post', 'action' => $this->getTitle()->getLocalURL( 'action=submit' ) ) ) . - wfMsgExt( 'wminc-languages-deleting-text', array( 'parseinline' ), $langcode )."\n". - Xml::openElement( 'table' ). - '<tr><td class="mw-label">' . Xml::label( wfMsg( 'deletecomment' ), 'mw-languages-deletereason') . '</td>' . - '<td class="mw-input">' . - Xml::input( 'wpLanguagesReason', 60, NULL, array( 'tabindex' => '1', 'id' => 'mw-languages-deletereason', 'maxlength' => '200' ) ) . - '</td></tr>' . - '<tr><td class="mw-submit">' . Xml::submitButton( wfMsg( 'delete' ), array( 'id' => 'mw-languages-submit' ) ) . - Xml::hidden( 'wpLanguagesCode3', $langcode ) . - Xml::hidden( 'wpLanguagesAction', 'delete' ) . - Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . - '</td></tr>' . - Xml::closeElement( 'table' ) . - Xml::closeElement( 'form' ) . - Xml::closeElement( 'fieldset' ) - ); - } - - function doSubmit() { - global $wgRequest, $wgOut, $wgLang; - $code3 = $wgRequest->getVal( 'wpLanguagesCode3' ); - $do = $wgRequest->getVal( 'wpLanguagesAction' ); - $reason = $wgRequest->getText( 'wpLanguagesReason' ); - $selfTitle = $this->getTitle(); - $dbw = wfGetDB( DB_MASTER ); - switch( $do ) { - case "delete": - $dbw->delete( 'inc_langs', array( 'code3' => $code3 ), __METHOD__ ); - - if ( $dbw->affectedRows() == 0 ) { - $this->error( 'languages-submit-delfailed', $code3 ); - $this->DeleteLanguage( $do ); - } else { - $wgOut->addWikiText( - wfMsg( 'wminc-languages-submit-deleted', $code3 ). - ' '. - wfMsg( 'wminc-languages-submit-viewlog' ) ); - $wgOut->returnToMain( false, $selfTitle ); - $log = new LogPage( 'languages' ); - $log->addEntry( 'lang_del', $selfTitle, $reason, array( $code3 ) ); - } - break; - case "edit": - case "add": - $data = array( - 'code1' => $wgRequest->getVal( 'wpLanguagesCode1' ), - 'code3' => $code3, - 'eng_name' => $wgRequest->getText( 'wpLanguagesEng' ), - 'native_name' => $wgRequest->getText( 'wpLanguagesNative' ), - 'valid' => $wgRequest->getVal( 'wpLanguagesValid' ), - 'ltr' => $wgRequest->getVal( 'wpLanguagesDir' ) ? 1 : 0, - ); - - if( $do == 'add' ) { - $dbw->insert( 'inc_langs', $data, __METHOD__, 'IGNORE' ); - } else { - $dbw->update( 'inc_langs', $data, array( 'code3' => $code3 ), __METHOD__, 'IGNORE' ); - } - - if( $dbw->affectedRows() == 0 ) { - $this->error( 'wminc-languages-submit-'.$do.'failed', $code3 ); - $this->showForm( $do ); - } else { - $wgOut->addWikiText( - wfMsg( 'wminc-languages-submit-'.$do.'ed', $code3 ). - ' '. - wfMsg( 'wminc-languages-submit-viewlog' ) ); - $wgOut->returnToMain( false, $selfTitle ); - $log = new LogPage( 'languages' ); - $log->addEntry( 'lang_'.$do, $selfTitle, $reason, - array( $code3, $wgLang->commaList($data) ) - ); - } - break; - } - } - - function showList( $admin ) { - global $wgUser, $wgOut, $wgScriptPath; - - /*======== FIXME ============ */ - $wgOut->addExtensionStyle( "{$wgScriptPath}/extensions/Interwiki/SpecialInterwiki.css" ); - - $wgOut->addWikiMsg( 'wminc-languages-intro' ); - $selfTitle = $this->getTitle(); - - $links = '<li>'.$wgUser->getSkin()->link( - SpecialPage::getTitleFor( 'Log' ), - wfMsgHtml( 'wminc-languages-intro-log' ), - array(), array( 'type' => 'languages' ) ). - '</li>'; - if ( $admin ) { - $links .= '<li>'. - $wgUser->getSkin()->link( $selfTitle, - wfMsgHtml( 'wminc-languages-intro-add' ), - array(), array( 'action' => 'add' ) ). - '</li>'; - } - $wgOut->addHTML( '<ul>' . $links . '</ul>' ); - - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'inc_langs', '*' ); - $numrows = $res->numRows(); - if ( $numrows == 0 ) { - $this->error( 'languages-error' ); - return; - } - - $out = ' - <table width="100%" class="mw-languagestable wikitable"> - <tr id="languagestable-header"> - <th>'.wfMsgHtml( 'wminc-languages-code3' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-code1' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-name-eng' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-name-native' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-valid' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-dir' ).'</th>'; - if( $admin ) { - $out .= '<th>'.wfMsgHtml( 'wminc-languages-edit' ).'</th>'; - } - $out .= "</tr>\n"; - - while( $s = $res->fetchObject() ) { - $code3 = htmlspecialchars( $s->code3 ); - $code1 = htmlspecialchars( $s->code1 ); - $valid = htmlspecialchars( $s->valid ); - $name_eng = htmlspecialchars( $s->eng_name ); - $name_native = htmlspecialchars( $s->native_name ); - $ltr = htmlspecialchars( $s->ltr ) ? 'LTR' : 'RTL'; - $out .= '<tr class="mw-languagestable-row"> - <td>'.$code3.'</td> - <td>'.$code1.'</td> - <td>'.$name_eng.'</td> - <td>'.$name_native.'</td> - <td>'.$valid.'</td> - <td>'.$ltr.'</td>'; - if( $admin ) { - $out .= '<td class="mw-languagestable-modify">'; - $out .= $wgUser->getSkin()->link( $selfTitle, wfMsgHtml( 'edit' ), array(), - array( 'action' => 'edit', 'lang' => $s->code3 ) ); - $out .= ', '; - $out .= $wgUser->getSkin()->link( $selfTitle, wfMsgHtml( 'delete' ), array(), - array( 'action' => 'delete', 'lang' => $s->code3 ) ); - $out .= '</td>'; - } - - $out .= "\n</tr>\n"; - } - $res->free(); - $out .= "</table><br />"; - $wgOut->addHTML( $out ); - } - - function error() { - global $wgOut; - $args = func_get_args(); - $wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args ); - } -} Modified: trunk/WikimediaIncubator.dev-i18n.php =================================================================== --- trunk/WikimediaIncubator.dev-i18n.php 2011-07-12 00:40:58 UTC (rev 17) +++ trunk/WikimediaIncubator.dev-i18n.php 2011-07-14 17:51:12 UTC (rev 18) @@ -19,9 +19,7 @@ 'wminc-languages-intro' => 'This is a list of languages that are defined in [[$1]].', 'wminc-languages-error' => 'There are no languages defined in [[$1]], or there was another error.', 'wminc-languages-code' => 'Language code', -# 'wminc-languages-code1' => 'ISO 639-1 code', - 'wminc-languages-code3' => 'ISO 639-3 code', - 'wminc-languages-name-eng' => 'English name', + 'wminc-languages-name-eng' => 'Name in English', 'wminc-languages-name-user' => 'Name in your language', 'wminc-languages-name-native' => 'Native name', 'wminc-languages-script' => 'Scripts', @@ -31,4 +29,22 @@ 'group-test-sysop' => 'Local administrators', 'group-test-sysop-member' => 'local administrator', 'grouppage-test-sysop' => 'Project:Local administrators', +); + +/** Nederlands (Dutch) + * @author SPQRobin + */ +$messages['nl'] = array( + + 'wminc-languages' => 'Talen', + 'wminc-languages-intro' => 'Dit is een lijst van talen zoals gedefinieerd op [[$1]].', + 'wminc-languages-error' => 'Er zijn geen talen gedefinieerd op [[$1]], of er was een andere fout.', + 'wminc-languages-code' => 'Taalcode', + 'wminc-languages-name-eng' => 'Naam in het Engels', + 'wminc-languages-name-user' => 'Naam in uw taal', + 'wminc-languages-projects' => 'Projecten', + + 'group-test-sysop' => 'Lokale beheerders', + 'group-test-sysop-member' => 'lokale beheerder', + 'grouppage-test-sysop' => 'Project:Lokale beheerders', ); \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-07-12 00:41:06
|
Revision: 17 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=17&view=rev Author: robin-p Date: 2011-07-12 00:40:58 +0000 (Tue, 12 Jul 2011) Log Message: ----------- * Make Special:Languages work with the page MediaWiki:Incubator-codes (done) * Add class IncubatorLanguages for that * Make file WikimediaIncubator.dev-i18n.php for all messages not in SVN, for easier updating of WikimediaIncubator.i18n.php * Flip $wmincProjects & $wmincSisterProjects arrays (more logical) * Formatting & other fixes Modified Paths: -------------- trunk/CreateAccountTestWiki-alt.php trunk/CreateAccountTestWiki.php trunk/IncubatorTest.php trunk/InfoPage.css trunk/InfoPage.php trunk/SpecialLanguages.php trunk/SpecialRequestWiki.php trunk/SpecialViewUserLang.php trunk/TestWikiDB.i18n.php trunk/TestWikiRC.php trunk/WikimediaIncubator.i18n.php trunk/WikimediaIncubator.php Added Paths: ----------- trunk/IncubatorLanguages.php trunk/SpecialLanguages (using db,log).php trunk/WikimediaIncubator.dev-i18n.php Modified: trunk/CreateAccountTestWiki-alt.php =================================================================== --- trunk/CreateAccountTestWiki-alt.php 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/CreateAccountTestWiki-alt.php 2011-07-12 00:40:58 UTC (rev 17) @@ -11,7 +11,7 @@ public static function onUserCreateForm( $template ) { global $wgRequest, $wmincProjects; $testwikivalue = strtolower( $wgRequest->getVal( 'testwiki', '' ) ); - if ( IncubatorTest::validateLanguageCode( $codevalue ) && in_array( $projectvalue, (array)$wmincProjects ) ) { + if ( IncubatorTest::validateLanguageCode( $codevalue ) && isset( $wmincProjects[$projectvalue] ) ) { $template->addInputItem( 'testwiki-project', $projectvalue, 'select', 'testwiki-project' ); $template->addInputItem( 'testwiki-code', @@ -24,7 +24,7 @@ global $wgRequest, $wmincProjects, $wmincPref; $projectvalue = $wgRequest->getVal( 'testwiki-project' ); $codevalue = $wgRequest->getVal( 'testwiki-code' ); - if ( IncubatorTest::validateLanguageCode( $codevalue ) && in_array( $projectvalue, (array)$wmincProjects ) ) { + if ( IncubatorTest::validateLanguageCode( $codevalue ) && isset( $wmincProjects[$projectvalue] ) ) { $user->setOption( $wmincPref . '-project', $projectvalue ); $user->setOption( $wmincPref . '-code', $codevalue ); $user->saveSettings(); Modified: trunk/CreateAccountTestWiki.php =================================================================== --- trunk/CreateAccountTestWiki.php 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/CreateAccountTestWiki.php 2011-07-12 00:40:58 UTC (rev 17) @@ -11,7 +11,7 @@ global $wgRequest, $wmincProjects; $projectvalue = strtolower( $wgRequest->getVal( 'testwikiproject', '' ) ); $codevalue = strtolower( $wgRequest->getVal( 'testwikicode', '' ) ); - if ( IncubatorTest::validateLanguageCode( $codevalue ) && in_array( $projectvalue, (array)$wmincProjects ) ) { + if ( IncubatorTest::validateLanguageCode( $codevalue ) && isset( $wmincProjects[$projectvalue] ) ) { $template->set( 'header', Html::hidden('testwiki-project', $projectvalue). Html::hidden('testwiki-code', $codevalue) @@ -24,7 +24,7 @@ global $wgRequest, $wmincProjects, $wmincPref; $projectvalue = $wgRequest->getVal( 'testwiki-project' ); $codevalue = $wgRequest->getVal( 'testwiki-code' ); - if ( IncubatorTest::validateLanguageCode( $codevalue ) && in_array( $projectvalue, (array)$wmincProjects ) ) { + if ( IncubatorTest::validateLanguageCode( $codevalue ) && isset( $wmincProjects[$projectvalue] ) ) { $user->setOption( $wmincPref . '-project', $projectvalue ); $user->setOption( $wmincPref . '-code', $codevalue ); $user->saveSettings(); Added: trunk/IncubatorLanguages.php =================================================================== --- trunk/IncubatorLanguages.php (rev 0) +++ trunk/IncubatorLanguages.php 2011-07-12 00:40:58 UTC (rev 17) @@ -0,0 +1,109 @@ +<?php +/** + * This class loads data about all defined languages. + */ + +class IncubatorLanguages { + public function __construct() { + $this->mLangNames = self::getLanguageNames(); + $this->mLangNamesEnglish = self::getLanguageNames( 'en' ); + $this->mLangsData = self::loadLanguagesData(); + } + + public function getNumber() { + return count( $this->mLangsData ); + } + + public function getDir( $lang ) { + $dir = isset( $this->mLangsData[$lang]['dir'] ) ? + $this->mLangsData[$lang]['dir'] : wfGetLangObj( $lang )->getDir(); + return strtolower( $dir ); + } + + /** + * Get the ISO 639-3 language code. + */ + public function getCode3( $lang ) { + return ''; # TODO + } + + public function getEnglishName( $lang ) { + return isset( $this->mLangNamesEnglish[$lang] ) ? + $this->mLangNamesEnglish[$lang] : ''; + } + + public function getUserLangName( $lang ) { + global $wgLang; + $getLangNames = self::getLanguageNames( $wgLang->getCode() ); + return isset( $getLangNames[$lang] ) ? $getLangNames[$lang] : ''; + } + + public function getNativeName( $lang ) { + return isset( $this->mLangsData[$lang]['nativename'] ) ? + $this->mLangsData[$lang]['nativename'] : ''; + } + + /** + * This loads language names. Also from CLDR if that extension is found. + * @return Array with language names or empty array + */ + static public function getLanguageNames( $code = '' ) { + if ( is_callable( array( 'LanguageNames', 'getNames' ) ) ) { + global $wgLang; + $langcode = ( $code ? $code : $wgLang->getCode() ); + return LanguageNames::getNames( $langcode, + LanguageNames::FALLBACK_NORMAL, + LanguageNames::LIST_MW_AND_CLDR + ); + } + return Language::getLanguageNames( false ); + } + + /** + * This loads languages data from the page MediaWiki:Incubator-codes. + * Format like: # code | type | otherinfo=blabla | moreinfo=blabla + * @return Array Empty or with languages data: + * 'code' => array( 'type' => '...', 'name' => 'value' ), + */ + static public function loadLanguagesData() { + global $wmincProjectSite, $wgMemc; + # Use caching if possible + $key = wfMemcKey( 'wminc-languagesdata' ); + $cachedData = $wgMemc->get( $key ); + if( is_array( $cachedData ) ) { + return $cachedData; + } + + $msg = wfMessage( strtolower( $wmincProjectSite['name'] . '-codes' ) )->inContentLanguage()->plain(); + $lines = preg_split( '#\n(?!s)#' , $msg ); + if( !is_array( $lines ) ) { + return array(); + } + $returndata = array(); + foreach( $lines as $line ) { + $codedata = explode( '|', trim( $line ) ); + if( !isset( $codedata[0] ) || !isset( $codedata[1] ) ) { continue; } + $code = trim( $codedata[0] ); + unset( $codedata[0] ); + foreach( $codedata as $i => $codedatum ) { + $codedatum = explode( '=', trim( $codedatum ) ); + if( isset( $codedatum[1] ) ) { + $returndata[$code][trim($codedatum[0])] = trim( $codedatum[1] ); + } else { + $returndata[$code]['type'] = trim( $codedatum[0] ); + } + # Add native language name if not set + if( !isset( $returndata[$code]['nativename'] ) ) { + $getLangNames = self::getLanguageNames( $code ); + if( isset( $getLangNames[$code] ) ) { + $returndata[$code]['nativename'] = $getLangNames[$code]; + } + } + } + } + ksort( $returndata ); + # Set cache + $wgMemc->set( $key, $returndata, 60*60*24*7 ); + return $returndata; + } +} \ No newline at end of file Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/IncubatorTest.php 2011-07-12 00:40:58 UTC (rev 17) @@ -1,10 +1,11 @@ <?php -/* -* Implement test wiki preference, magic word and prefix check on edit page -*/ +/** + * Main class of the incubator extension. + * Implement test wiki preference, magic word and prefix check on edit page, + * and contains general functions for other classes. + */ -class IncubatorTest -{ +class IncubatorTest { static function onGetPreferences( $user, &$preferences ) { global $wmincPref, $wmincProjects, $wmincProjectSite, $wmincLangCodeLength, $wgDefaultUserOptions; @@ -13,8 +14,11 @@ $prefinsert[$wmincPref . '-project'] = array( 'type' => 'select', - 'options' => array( wfMsg( 'wminc-testwiki-none' ) => 'none' ) + - (array)$wmincProjects + array( $wmincProjectSite['name'] => $wmincProjectSite['short'] ), + 'options' => + array( wfMsg( 'wminc-testwiki-none' ) => 'none' ) + + array_flip( $wmincProjects ) + + array( $wmincProjectSite['name'] => $wmincProjectSite['short'] + ), 'section' => 'personal/i18n', 'label-message' => 'wminc-testwiki', 'id' => $wmincPref . '-project', @@ -40,18 +44,23 @@ static function validateCodePreference( $input, $alldata ) { global $wmincPref, $wmincProjects; - // If the user selected a project that NEEDS a language code, but the user DID NOT enter a language code, give an error - if ( isset( $alldata[$wmincPref.'-project'] ) && in_array( $alldata[$wmincPref.'-project'], $wmincProjects ) && !$input ) { - return Xml::element( 'span', array( 'class' => 'error' ), wfMsg( 'wminc-prefinfo-error' ) ); + # If the user selected a project that NEEDS a language code, + # but the user DID NOT enter a language code, give an error + if ( isset( $alldata[$wmincPref.'-project'] ) && + array_key_exists( $alldata[$wmincPref.'-project'], $wmincProjects ) && + !$input ) { + return Xml::element( 'span', array( 'class' => 'error' ), + wfMsg( 'wminc-prefinfo-error' ) ); } else { return true; } } - /* - * This validates a given language code. - * Only "xx[x]" and "xx[x]-x[xxxxxxxx]" are allowed. - */ + /** + * This validates a given language code. + * Only "xx[x]" and "xx[x]-x[xxxxxxxx]" are allowed. + * @return boolean + */ static function validateLanguageCode( $code ) { global $wmincLangCodeLength; if( strlen( $code ) > $wmincLangCodeLength ) { return false; } @@ -59,16 +68,16 @@ return (bool) preg_match( '/^[a-z][a-z][a-z]?(-[a-z]+)?$/', $code ); } - /* - * This validates a full prefix in a given title. - * It gives an array with the project and language code, containing - * the key 'error' if it is invalid. - * Use validatePrefix() if you just want true or false. - * Use displayPrefixedTitle() to make a prefix page title! - * - * @param $onlyInfoPage Bool Whether to validate only the prefix, or - * also allow other text within the page title (Wx/xxx vs Wx/xxx/Text) - */ + /** + * This validates a full prefix in a given title. + * It gives an array with the project and language code, containing + * the key 'error' if it is invalid. + * Use validatePrefix() if you just want true or false. + * Use displayPrefixedTitle() to make a prefix page title! + * + * @param $onlyInfoPage Bool Whether to validate only the prefix, or + * also allow other text within the page title (Wx/xxx vs Wx/xxx/Text) + */ static function analyzePrefix( $title, $onlyInfoPage = false ) { $data = array(); // split title into parts @@ -85,7 +94,7 @@ } } global $wmincProjects; - $listProjects = implode( '', $wmincProjects ); // something like: pbtqn + $listProjects = implode( '', array_keys( $wmincProjects ) ); // something like: pbtqn if( !preg_match( '/^W['.$listProjects.']\/[a-z-]+' . ($onlyInfoPage ? '$/' : '(\/.+)?$/' ), $title ) ) { $data['error'] = 'invalidprefix'; @@ -99,35 +108,37 @@ return $data; // return an array with information } - /* - * This returns simply true or false based on analyzePrefix(). - */ + /** + * This returns simply true or false based on analyzePrefix(). + */ static function validatePrefix( $title, $onlyprefix = false ) { $data = self::analyzePrefix( $title, $onlyprefix ); if( !isset( $data['error'] ) ) { return true; } return false; } - /* - * Returns true if the given project (or preference - * by default) is one of the projects using the - * format Wx/xxx (as defined in $wmincProjects) - */ + /** + * Whether the given project (or preference by default) is one of the + * projects using the format Wx/xxx (as defined in $wmincProjects) + * @param $project the project code + * @return Boolean + */ static function isContentProject( $project = '' ) { global $wgUser, $wmincPref, $wmincProjects; - $project = ($project ? $project : $wgUser->getOption($wmincPref . '-project') ); - return (bool) in_array( $project, $wmincProjects ); + $project = ( $project ? $project : $wgUser->getOption($wmincPref . '-project') ); + return (bool) array_key_exists( $project, $wmincProjects ); } - /* - * display the prefix by the given project and code - * (or the user preference if no parameters are given) - */ - static function displayPrefix( $project = '', $code = '' ) { - global $wgUser, $wmincPref; + /** + * display the prefix by the given project and code + * (or the user preference if no parameters are given) + */ + static function displayPrefix( $project = '', $code = '', $allowSister = false ) { + global $wgUser, $wmincPref, $wmincSisterProjects; $projectvalue = ( $project ? $project : $wgUser->getOption($wmincPref . '-project') ); $codevalue = ( $code ? $code : $wgUser->getOption($wmincPref . '-code') ); - if ( self::isContentProject( $projectvalue ) ) { + $sister = (bool)( $allowSister && isset( $wmincSisterProjects[$projectvalue] ) ); + if ( self::isContentProject( $projectvalue ) || $sister ) { // if parameters are set OR it falls back to user pref and // he has a content project pref set -> return the prefix return 'W' . $projectvalue . '/' . $codevalue; // return the prefix @@ -138,10 +149,10 @@ } } - /* - * Makes a full prefixed title of a given page title and namespace - * @param $ns Int numeric value of namespace - */ + /** + * Makes a full prefixed title of a given page title and namespace + * @param $ns Int numeric value of namespace + */ static function displayPrefixedTitle( $title, $ns = 0 ) { global $wgLang, $wmincTestWikiNamespaces; if( in_array( $ns, $wmincTestWikiNamespaces ) ) { @@ -180,8 +191,9 @@ return true; } - /* Return an error if the user wants to create an unprefixed page - */ + /** + * Return an error if the user wants to create an unprefixed page + */ static function checkPrefixCreatePermissions( $title, $user, $action, &$result ) { global $wmincProjectSite, $wmincTestWikiNamespaces, $wmincPseudoCategoryNSes; $titletext = $title->getText(); @@ -221,9 +233,10 @@ return false; } - /* Return an error if the user wants to move - * an existing page to an unprefixed title - */ + /** + * Return an error if the user wants to move + * an existing page to an unprefixed title + */ static function checkPrefixMovePermissions( $oldtitle, $newtitle, $user, &$error ) { global $wmincProjectSite, $wmincTestWikiNamespaces; $prefixdata = self::analyzePrefix( $newtitle->getText() ); @@ -244,11 +257,11 @@ } /** - * Add a link to Special:ViewUserLang from Special:Contributions/USERNAME - * if the user has 'viewuserlang' permission - * Based on code from extension LookupUser made by Tim Starling - * @return true - */ + * Add a link to Special:ViewUserLang from Special:Contributions/USERNAME + * if the user has 'viewuserlang' permission + * Based on code from extension LookupUser made by Tim Starling + * @return true + */ static function efLoadViewUserLangLink( $id, $nt, &$links ) { global $wgUser; if ( $wgUser->isAllowed( 'viewuserlang' ) ) { @@ -263,8 +276,10 @@ // ########### START DEVELOPMENT STUFF ############# - # Make the page content language depend on the test wiki - # Only works for codes that are known to MediaWiki :( + /** + * Make the page content language depend on the test wiki + * Only works for codes that are known to MediaWiki :( + */ static function onPageContentLanguage( $title, &$pageLang ) { global $wmincTestWikiNamespaces; $prefix = IncubatorTest::analyzePrefix( $title, @@ -280,7 +295,9 @@ return true; } - # Missing article on Wx/xx inf pages: show welcome page + /** + * Missing article on Wx/xx inf pages: show welcome page + */ static function onShowMissingArticle( $article ) { $titleObject = $article->mTitle; $prefix = IncubatorTest::analyzePrefix( $titleObject, true ); @@ -293,8 +310,10 @@ return true; } - # When creating a new info page, help the user by prefilling it - # NEED TO IMPROVE THIS + /** + * When creating a new info page, help the user by prefilling it + * NEED TO IMPROVE THIS + */ public static function onEditFormPreloadText( &$text, &$title ) { $pagetitle = $title->getText(); $prefix = IncubatorTest::analyzePrefix( $pagetitle, true /* only info page */ ); @@ -342,10 +361,10 @@ return array( $infopage->showIncubatingWiki(), 'isHTML' => true ); } - /* - * If we can get this to work perfectly, it can replace the AddPrefix gadget - * (I'm not so experienced with regex..) - */ + /** + * If we can get this to work perfectly, it can replace the AddPrefix gadget + * (I'm not so experienced with regex..) + */ function onArticleSave (&$article, &$user, &$text) { $prefixdata = self::analyzePrefix( $article->getTitle() ); /*if( isset( $prefixdata['error'] ) ) { @@ -360,10 +379,10 @@ return true; } - /* - * Display a different logo in current test wiki - * if it is set in MediaWiki:Incubator-logo-wx/xxx - */ + /** + * Display a different logo in current test wiki + * if it is set in MediaWiki:Incubator-logo-wx/xxx + */ function fnTestWikiLogo( &$out, &$sk ) { global $wmincTestWikiNamespaces, $wgLogo; # return if the page is not in one of the test wiki namespaces Modified: trunk/InfoPage.css =================================================================== --- trunk/InfoPage.css 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/InfoPage.css 2011-07-12 00:40:58 UTC (rev 17) @@ -23,4 +23,4 @@ .wminc-infopage-text { font-size: 125%; } .wminc-infopage-missingwiki-options { padding: .2em; } .wminc-infopage-logo { float: right; } -.wminc-infopage-createmainpage { margin-left: .5em; font-weight: bold; } \ No newline at end of file +.wminc-infopage-createmainpage { margin-left: .5em; font-weight: bold; } Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/InfoPage.php 2011-07-12 00:40:58 UTC (rev 17) @@ -11,7 +11,7 @@ 'created': This project has been approved by the language committee and is now available at xyz.wikiproject.org. 'beforeincubator': This project was created before Wikimedia Incubator started and is available at xyz.wikiproject.org. */ -// This class is used for "Wx/xx(x)" pages +# This class is used for "Wx/xx(x)" pages class InfoPage { public function __construct( $title, $prefixdata ) { if( isset( $prefixdata['error'] ) || $title->getNamespace() != NS_MAIN ) { @@ -21,19 +21,14 @@ $this->mPrefix = $prefixdata['prefix']; $this->mLangCode = $prefixdata['lang']; $this->mProjectCode = $prefixdata['project']; - $this->mProjectName = array_search( $this->mProjectCode, $wmincProjects); - // Redirect to real main page if URL is Wx/xxx?goto=mainpage - if($wgRequest->getVal('goto') == 'mainpage') { - // need to find a proper way - global $wgServer, $wgArticlePath; - if( $this->mSubdomain == true ) { - header('Location: '.$this->getMainPage() ); - } else { - header('Location: '.$wgServer.$wgArticlePath.$this->getMainPage() ); - } + $this->mProjectName = isset( $wmincProjects[$this->mProjectCode] ) ? + $wmincProjects[$this->mProjectCode] : ''; + # Redirect to real main page if URL is Wx/xxx?goto=mainpage + if( $wgRequest->getVal('goto') == 'mainpage' ) { + $this->redirectToMainPage(); } - $this->mLangNames = $this->getLanguageNames(); - $this->mLangsData = $this->loadLanguagesData(); + $this->mLangNames = IncubatorLanguages::getLanguageNames(); + $this->mLangsData = IncubatorLanguages::loadLanguagesData(); $this->mThisLangData = ( isset( $this->mLangsData[$this->mLangCode] ) ? $this->mLangsData[$this->mLangCode] : array( 'type' => 'open' ) ); $this->mLangName = ( isset( $this->mLangNames[$this->mLangCode] ) ? @@ -41,54 +36,32 @@ return; } - public function getLanguageNames( $code = '' ) { - // get data from CLDR extension if possible - if ( is_callable( array( 'LanguageNames', 'getNames' ) ) ) { - global $wgLang; - $langcode = ( $code ? $code : $wgLang->getCode() ); - return LanguageNames::getNames( $langcode, - LanguageNames::FALLBACK_NORMAL, - LanguageNames::LIST_MW_AND_CLDR - ); - } - // If we need to display something, use this as fallback - return Language::getLanguageNames( false ); - } - - public function loadLanguagesData() { - // return if MediaWiki:Incubator-code does not exists - $pagetitle = Title::makeTitle( NS_MEDIAWIKI, 'Incubator-codes' ); - if( !$pagetitle->exists() ) { - return; - } - $article = new Article( $pagetitle ); - if( !$article->getTitle() ) { - return; - } - $lines = preg_split( '#\n(?!s)#' , $article->getRawText() ); - // format like: - // code | type | otherinfo=blabla | moreinfo=blabla - foreach( $lines as $line ) { - $codedata = explode( '|', trim( $line ) ); - if( !isset( $codedata[0] ) || !isset( $codedata[1] ) ) { continue; } - $code = trim( $codedata[0] ); - unset( $codedata[0] ); - foreach( $codedata as $i => $codedatum ) { - $codedatum = explode( '=', trim( $codedatum ) ); - if( isset( $codedatum[1] ) ) { - $returndata[$code][trim($codedatum[0])] = trim( $codedatum[1] ); - } else { - $returndata[$code]['type'] = trim( $codedatum[0] ); - } + /* + * Either rediret to the subdomain, or to the main page of the test wiki + * In the second case, it adds &redirectfrom and &uselang=xx if set + */ + public function redirectToMainPage() { + # need to find a proper way + if( isset( $this->mSubdomain ) && $this->mSubdomain == true ) { + header( 'Location: ' . $this->getMainPage() ); + } else { + global $wgOut, $wgRequest; + $params = 'redirectfrom=infopage'; + $uselang = $wgRequest->getVal( 'uselang' ); + if( $uselang ) { + $params .= '&uselang=' . $uselang; } + $mainpage = Title::newFromText( $this->getMainPage() ); + $url = $mainpage->getFullURL( $params ); + $wgOut->redirect( $url ); } - return $returndata; + return; } - // Small convenience function to display a (clickable) logo + # Small convenience function to display a (clickable) logo public function makeLogo( $project, $clickable = true, $width = 25, $height = '', $url = '', $args = '' ) { $projectForFile = preg_replace('/ /', '-', strtolower( $project ) ); - // TEMPORARILY TO REDUCE PAGE LOAD + # TEMPORARILY TO REDUCE PAGE LOAD $imageobj = '';/*wfFindFile( wfMsg( 'wminc-logo-' . $projectForFile ) );*/ if ( $imageobj ) { $thumb = $imageobj->transform( array( 'width' => $width ) ); @@ -96,7 +69,7 @@ '" title="'.$project.'" alt="'.$project. '" width="'.$width.'" height="'.$height.'" '.$args.' />'; } else { - $logo = $project; // image not found + $logo = $project; # image not found } if( $clickable ) { $useurl = ($url ? $url : 'http://www.'.strtolower( $project ).'.org/'); @@ -109,7 +82,7 @@ public function listOtherProjects() { global $wmincProjects, $wmincSisterProjects; $otherProjects = $wmincProjects + $wmincSisterProjects; - foreach($otherProjects as $name => $code) { + foreach( $otherProjects as $code => $name ) { $listOtherProjects[$code] = '<li>' . $this->makeLogo( $name, true, 75, NULL, $this->getSubdomain( $name ) ) . '</li>'; } @@ -129,16 +102,16 @@ implode( '', $list ) . '</ul>'; } - // TODO: add support for secure server? + # TODO: add support for secure server? public function getSubdomain( $project = '', $protocol = true ) { return ( $protocol ? 'http://' : '') . $this->mLangCode . '.' . strtolower( $project ? $project : $this->mProjectName ) . '.org'; } - // make "Wx/xxx/Main Page" + # make "Wx/xxx/Main Page" public function getMainPage( $withprefix = true ) { - // Get the provided value, otherwise take the "mainpage" msg - // in the language of this test wiki + # Get the provided value, otherwise take the "mainpage" msg + # in the language of this test wiki $msg = ( isset( $this->mMainPage ) ? $this->mMainPage : wfMsgExt( 'mainpage', array( 'language' => $this->mLangCode ) ) ); if( !$withprefix ) { return $msg; } Added: trunk/SpecialLanguages (using db,log).php =================================================================== --- trunk/SpecialLanguages (using db,log).php (rev 0) +++ trunk/SpecialLanguages (using db,log).php 2011-07-12 00:40:58 UTC (rev 17) @@ -0,0 +1,354 @@ +<?php +$wgSpecialPages['Languages'] = 'SpecialLanguages'; +$wgSpecialPageGroups['Languages'] = 'wiki'; + +$wgAvailableRights[] = 'editlangs'; +$wgGroupPermissions['sysop']['editlangs'] = true; + +$wgLogTypes[] = 'languages'; +$wgLogNames['languages'] = 'wminc-languages-log-name'; +$wgLogHeaders['languages'] = 'wminc-languages-log-text'; +$wgLogActions['languages/languages'] = 'wminc-languages-log-entry'; +$wgLogActions['languages/lang_add'] = 'wminc-languages-log-added'; +$wgLogActions['languages/lang_del'] = 'wminc-languages-log-deleted'; +$wgLogActions['languages/lang_edit'] = 'wminc-languages-log-edited'; + +$wgExtensionMessagesFiles['TestWikiDB'] = $dir . 'TestWikiDB.i18n.php'; + +/** + * implements Special:Languages + * @ingroup SpecialPage + */ +class SpecialLanguages extends SpecialPage { + function __construct() { + parent::__construct( 'Languages' ); + } + + function execute( $par ) { + global $wgRequest, $wgOut, $wgUser; + + wfLoadExtensionMessages( 'TestWikiDB' ); + + $admin = $wgUser->isAllowed( 'editlangs' ); + + $this->setHeaders(); + $this->outputHeader(); + + if ( $admin ) { + $wgOut->setPagetitle( wfMsg( 'wminc-languages' ) ); + } else { + $wgOut->setPagetitle( wfMsg( 'wminc-languages-title-norights' ) ); + } + $action = $wgRequest->getVal( 'action', $par ); + + switch( $action ){ + case "delete": + if($admin) { + $this->DeleteLanguage(); + } else { + $wgOut->permissionRequired('editlangs'); + } + break; + case "edit": + if($admin) { + $this->EditLanguage(); + } else { + $wgOut->permissionRequired('editlangs'); + } + break; + case "add": + if($admin) { + $this->AddLanguage(); + } else { + $wgOut->permissionRequired('editlangs'); + } + break; + case "submit": + if( !$admin ){ + $wgOut->permissionRequired( 'editlangs' ); + return; + } + if( !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { + $wgOut->addWikiMsg( 'sessionfailure' ); + return; + } + $this->doSubmit(); + break; + default: + $this->showList( $admin ); + break; + } + } + + function FormRow( $name, $input ) { + return '<tr>'. + '<td class="mw-label">'.Xml::label( wfMsg( 'wminc-languages-'.$name ), 'mw-languages-'.$name ).'</td>'. + '<td class="mw-input">'.$input.'</td>'. + '</tr>'; + } + + function SelectValidity( $currentvalue ) { + $options = array( + 'tocheck' => 'code has to be checked (default value)', + 'valid' => 'a valid ISO 639 language code', + 'invalid' => 'an invalid ISO 639 language code (i.e. will not be accepted by the langcom)', + 'art' => 'artificial, constructed language', + 'history' => 'not spoken anymore (corresponds to "extinct", "historical" and "ancient" values of SIL)', + 'exists' => 'all WMF projects exist in that language (Wikisource and Wikiversity do not count)', + 'macro' => 'a macrolanguage, as defined by SIL', + 'collect' => 'collection of languages, as defined by SIL', + 'nearext' => 'nearly extinct, a language with very few speakers left', + 'special' => 'other situations', + ); + $out = '<select name="wpLanguagesValid" id="mw-languages-valid">'; + foreach($options as $option => $desc) { + $out .= '<option value="'.$option.'"'; + if($currentvalue == $option) { $out .= ' selected'; } + $out .= '><i>'.$option.'</i> || '.$desc.'</option>'; + } + $out .= '</select>'; + return $out; + } + + function AddLanguage() { + global $wgRequest, $wgUser, $wgOut; + $wgOut->addHTML( + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsgExt( 'wminc-languages-intro-add', array( 'parseinline' ) ) ) . + Xml::openElement( 'form', array('id'=> 'mw-languages-editform', 'method'=> 'post', 'action'=> $this->getTitle()->getLocalURL( 'action=submit' ) ) ) . + Xml::openElement( 'table', array('id'=>'mw-languages-add') ) . + "\n" . + self::FormRow('code3', Xml::input( 'wpLanguagesCode3', 3, $wgRequest->getVal( 'lang' ), array('id'=>'mw-languages-code3', 'maxlength'=>3) ) ). + self::FormRow('code1', Xml::input( 'wpLanguagesCode1', 2, NULL, array('id'=>'mw-languages-code1', 'maxlength'=>2) ) ). + self::FormRow('name-eng', Xml::input( 'wpLanguagesEng', 60, NULL, array('id'=>'mw-languages-eng') ) ). + self::FormRow('name-native', '<i>Not yet definable</i>' ). + self::FormRow('valid', self::SelectValidity( NULL ) ). + self::FormRow('dir', + Xml::radio( 'wpLanguagesDir', 1, true, array('id'=>'mw-languages-dir') ).'LTR'. + Xml::radio( 'wpLanguagesDir', 0, false, array('id'=>'mw-languages-dir') ).'RTL' + ). + self::FormRow('reason', Xml::input( 'wpLanguagesReason', 60, NULL, array( 'tabindex'=>'1', 'id'=>'mw-languages-reason', 'maxlength'=>'200') ) ). + Xml::hidden( 'wpLanguagesAction', 'add' ) . + Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . + '<tr><td class="mw-submit">' . Xml::submitButton( wfMsg( 'tooltip-save' ), array( 'id'=>'mw-languages-submit' ) ) . '</td></tr>' . + Xml::closeElement( 'table' ) . + Xml::closeElement( 'form' ) . + Xml::closeElement( 'fieldset' ) + ); + } + + function EditLanguage() { + global $wgRequest, $wgUser, $wgOut; + $langcode = $wgRequest->getVal( 'lang' ); + $dbr = wfGetDB( DB_SLAVE ); + $row = $dbr->selectRow( 'inc_langs', '*', array( 'code3' => $langcode ) ); + if( !$row ){ + $this->error( 'languages-editerror', $langcode ); + return; + } + $wgOut->addHTML( + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsgExt( 'wminc-languages-intro-add', array( 'parseinline' ) ) ) . + Xml::openElement( 'form', array('id'=> 'mw-languages-editform', 'method'=> 'post', 'action'=> $this->getTitle()->getLocalURL( 'action=submit' ) ) ) . + Xml::openElement( 'table', array('id'=>'mw-languages-edit') ) . + "\n" . + self::FormRow('code3', $langcode ). + self::FormRow('code1', Xml::input( 'wpLanguagesCode1', 2, $row->code1, array('id'=>'mw-languages-code1', 'maxlength'=>2) ) ). + self::FormRow('name-eng', Xml::input( 'wpLanguagesEng', 60, $row->eng_name, array('id'=>'mw-languages-eng') ) ). + self::FormRow('name-native', self::EditLanguageNativeName( $langcode, $row->code1, $row ) ). + self::FormRow('valid', self::SelectValidity( $row->valid ) ). + self::FormRow('dir', + Xml::radio( 'wpLanguagesDir', 1, true, array('id'=>'mw-languages-dir') ).'LTR'. + Xml::radio( 'wpLanguagesDir', 0, false, array('id'=>'mw-languages-dir') ).'RTL' + ). + self::FormRow('reason', Xml::input( 'wpLanguagesReason', 60, NULL, array( 'tabindex'=>'1', 'id'=>'mw-languages-reason', 'maxlength'=>'200') ) ). + Xml::hidden( 'wpLanguagesAction', 'edit' ) . + Xml::hidden( 'wplanguagesCode3', $row->code3 ) . + Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . + '<tr><td class="mw-submit">' . Xml::submitButton( wfMsg( 'tooltip-save' ), array( 'id'=>'mw-languages-submit' ) ) . '</td></tr>' . + Xml::closeElement( 'table' ) . + Xml::closeElement( 'form' ) . + Xml::closeElement( 'fieldset' ) + ); + } + + function EditLanguageNativeName( $code3, $code1, $row ) { + // This function displays the native name if it has already been defined in MediaWiki, else it shows an input field to enter one. + global $wgLanguageNames; + if(preg_match('/[a-z][a-z]/', $code1)) { + $langcode = $code1; + } else { + $langcode = $code3; + } + if(isset($wgLanguageNames[$langcode])) { + return '<b>'.$wgLanguageNames[$langcode].'</b>'; + } else { + return Xml::input( 'wpLanguagesNative', 60, $row->native_name, array('id'=>'mw-languages-native') ); + } + } + + function DeleteLanguage() { + global $wgRequest, $wgUser, $wgOut; + $langcode = $wgRequest->getVal( 'lang' ); + $wgOut->addHTML( + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsg( 'wminc-languages-deleting-title', $langcode ) ) . + Xml::openElement( 'form', array('id'=> 'mw-languages-deleteform', 'method'=> 'post', 'action' => $this->getTitle()->getLocalURL( 'action=submit' ) ) ) . + wfMsgExt( 'wminc-languages-deleting-text', array( 'parseinline' ), $langcode )."\n". + Xml::openElement( 'table' ). + '<tr><td class="mw-label">' . Xml::label( wfMsg( 'deletecomment' ), 'mw-languages-deletereason') . '</td>' . + '<td class="mw-input">' . + Xml::input( 'wpLanguagesReason', 60, NULL, array( 'tabindex' => '1', 'id' => 'mw-languages-deletereason', 'maxlength' => '200' ) ) . + '</td></tr>' . + '<tr><td class="mw-submit">' . Xml::submitButton( wfMsg( 'delete' ), array( 'id' => 'mw-languages-submit' ) ) . + Xml::hidden( 'wpLanguagesCode3', $langcode ) . + Xml::hidden( 'wpLanguagesAction', 'delete' ) . + Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . + '</td></tr>' . + Xml::closeElement( 'table' ) . + Xml::closeElement( 'form' ) . + Xml::closeElement( 'fieldset' ) + ); + } + + function doSubmit() { + global $wgRequest, $wgOut, $wgLang; + $code3 = $wgRequest->getVal( 'wpLanguagesCode3' ); + $do = $wgRequest->getVal( 'wpLanguagesAction' ); + $reason = $wgRequest->getText( 'wpLanguagesReason' ); + $selfTitle = $this->getTitle(); + $dbw = wfGetDB( DB_MASTER ); + switch( $do ) { + case "delete": + $dbw->delete( 'inc_langs', array( 'code3' => $code3 ), __METHOD__ ); + + if ( $dbw->affectedRows() == 0 ) { + $this->error( 'languages-submit-delfailed', $code3 ); + $this->DeleteLanguage( $do ); + } else { + $wgOut->addWikiText( + wfMsg( 'wminc-languages-submit-deleted', $code3 ). + ' '. + wfMsg( 'wminc-languages-submit-viewlog' ) ); + $wgOut->returnToMain( false, $selfTitle ); + $log = new LogPage( 'languages' ); + $log->addEntry( 'lang_del', $selfTitle, $reason, array( $code3 ) ); + } + break; + case "edit": + case "add": + $data = array( + 'code1' => $wgRequest->getVal( 'wpLanguagesCode1' ), + 'code3' => $code3, + 'eng_name' => $wgRequest->getText( 'wpLanguagesEng' ), + 'native_name' => $wgRequest->getText( 'wpLanguagesNative' ), + 'valid' => $wgRequest->getVal( 'wpLanguagesValid' ), + 'ltr' => $wgRequest->getVal( 'wpLanguagesDir' ) ? 1 : 0, + ); + + if( $do == 'add' ) { + $dbw->insert( 'inc_langs', $data, __METHOD__, 'IGNORE' ); + } else { + $dbw->update( 'inc_langs', $data, array( 'code3' => $code3 ), __METHOD__, 'IGNORE' ); + } + + if( $dbw->affectedRows() == 0 ) { + $this->error( 'wminc-languages-submit-'.$do.'failed', $code3 ); + $this->showForm( $do ); + } else { + $wgOut->addWikiText( + wfMsg( 'wminc-languages-submit-'.$do.'ed', $code3 ). + ' '. + wfMsg( 'wminc-languages-submit-viewlog' ) ); + $wgOut->returnToMain( false, $selfTitle ); + $log = new LogPage( 'languages' ); + $log->addEntry( 'lang_'.$do, $selfTitle, $reason, + array( $code3, $wgLang->commaList($data) ) + ); + } + break; + } + } + + function showList( $admin ) { + global $wgUser, $wgOut, $wgScriptPath; + + /*======== FIXME ============ */ + $wgOut->addExtensionStyle( "{$wgScriptPath}/extensions/Interwiki/SpecialInterwiki.css" ); + + $wgOut->addWikiMsg( 'wminc-languages-intro' ); + $selfTitle = $this->getTitle(); + + $links = '<li>'.$wgUser->getSkin()->link( + SpecialPage::getTitleFor( 'Log' ), + wfMsgHtml( 'wminc-languages-intro-log' ), + array(), array( 'type' => 'languages' ) ). + '</li>'; + if ( $admin ) { + $links .= '<li>'. + $wgUser->getSkin()->link( $selfTitle, + wfMsgHtml( 'wminc-languages-intro-add' ), + array(), array( 'action' => 'add' ) ). + '</li>'; + } + $wgOut->addHTML( '<ul>' . $links . '</ul>' ); + + $dbr = wfGetDB( DB_SLAVE ); + $res = $dbr->select( 'inc_langs', '*' ); + $numrows = $res->numRows(); + if ( $numrows == 0 ) { + $this->error( 'languages-error' ); + return; + } + + $out = ' + <table width="100%" class="mw-languagestable wikitable"> + <tr id="languagestable-header"> + <th>'.wfMsgHtml( 'wminc-languages-code3' ).'</th> + <th>'.wfMsgHtml( 'wminc-languages-code1' ).'</th> + <th>'.wfMsgHtml( 'wminc-languages-name-eng' ).'</th> + <th>'.wfMsgHtml( 'wminc-languages-name-native' ).'</th> + <th>'.wfMsgHtml( 'wminc-languages-valid' ).'</th> + <th>'.wfMsgHtml( 'wminc-languages-dir' ).'</th>'; + if( $admin ) { + $out .= '<th>'.wfMsgHtml( 'wminc-languages-edit' ).'</th>'; + } + $out .= "</tr>\n"; + + while( $s = $res->fetchObject() ) { + $code3 = htmlspecialchars( $s->code3 ); + $code1 = htmlspecialchars( $s->code1 ); + $valid = htmlspecialchars( $s->valid ); + $name_eng = htmlspecialchars( $s->eng_name ); + $name_native = htmlspecialchars( $s->native_name ); + $ltr = htmlspecialchars( $s->ltr ) ? 'LTR' : 'RTL'; + $out .= '<tr class="mw-languagestable-row"> + <td>'.$code3.'</td> + <td>'.$code1.'</td> + <td>'.$name_eng.'</td> + <td>'.$name_native.'</td> + <td>'.$valid.'</td> + <td>'.$ltr.'</td>'; + if( $admin ) { + $out .= '<td class="mw-languagestable-modify">'; + $out .= $wgUser->getSkin()->link( $selfTitle, wfMsgHtml( 'edit' ), array(), + array( 'action' => 'edit', 'lang' => $s->code3 ) ); + $out .= ', '; + $out .= $wgUser->getSkin()->link( $selfTitle, wfMsgHtml( 'delete' ), array(), + array( 'action' => 'delete', 'lang' => $s->code3 ) ); + $out .= '</td>'; + } + + $out .= "\n</tr>\n"; + } + $res->free(); + $out .= "</table><br />"; + $wgOut->addHTML( $out ); + } + + function error() { + global $wgOut; + $args = func_get_args(); + $wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args ); + } +} Modified: trunk/SpecialLanguages.php =================================================================== --- trunk/SpecialLanguages.php 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/SpecialLanguages.php 2011-07-12 00:40:58 UTC (rev 17) @@ -1,35 +1,6 @@ <?php -$wgSpecialPages['Languages'] = 'SpecialLanguages'; -$wgSpecialPageGroups['Languages'] = 'wiki'; - -$wgAvailableRights[] = 'editlangs'; -$wgGroupPermissions['sysop']['editlangs'] = true; - -$wgLogTypes[] = 'languages'; -$wgLogNames['languages'] = 'wminc-languages-log-name'; -$wgLogHeaders['languages'] = 'wminc-languages-log-text'; -$wgLogActions['languages/languages'] = 'wminc-languages-log-entry'; -$wgLogActions['languages/lang_add'] = 'wminc-languages-log-added'; -$wgLogActions['languages/lang_del'] ='wminc-languages-log-deleted'; -$wgLogActions['languages/lang_edit'] = 'wminc-languages-log-edited'; - -$wgExtensionMessagesFiles['TestWikiDB'] = $dir . 'TestWikiDB.i18n.php'; - -$wmincLangCodeValidityOptions = array( - 'tocheck' => 'code has to be checked (default value)', - 'valid' => 'a valid ISO 639 language code', - 'invalid' => 'an invalid ISO 639 language code (i.e. will not be accepted by the langcom)', - 'art' => 'artificial, constructed language', - 'history' => 'not spoken anymore (corresponds to "extinct", "historical" and "ancient" values of SIL)', - 'exists' => 'all WMF projects exist in that language (Wikisource and Wikiversity do not count)', - 'macro' => 'a macrolanguage, as defined by SIL', - 'collect' => 'collection of languages, as defined by SIL', - 'nearext' => 'nearly extinct, a language with very few speakers left', - 'special' => 'other situations', -); - /** - * implements Special:Languages + * implements Special:Languages, based on * @ingroup SpecialPage */ class SpecialLanguages extends SpecialPage { @@ -37,311 +8,100 @@ parent::__construct( 'Languages' ); } - function execute( $par ) { - global $wgRequest, $wgOut, $wgUser; + function getDescription() { + return wfMsg( 'wminc-languages' ); + } - wfLoadExtensionMessages( 'TestWikiDB' ); - - $admin = $wgUser->isAllowed( 'editlangs' ); - + function execute() { $this->setHeaders(); $this->outputHeader(); - $admin = $wgUser->isAllowed( 'editlangs' ); - if ( $admin ) { - $wgOut->setPagetitle( wfMsg( 'wminc-languages' ) ); - } else { - $wgOut->setPagetitle( wfMsg( 'languages-title-norights' ) ); - } - $action = $wgRequest->getVal( 'action', $par ); + $this->showList(); + } - switch( $action ){ - case "delete": - case "edit" : - case "add" : - if( !$admin ){ - $wgOut->permissionRequired('editlangs'); - return; - } - $this->showForm( $action ); - break; - case "submit": - if( !$admin ){ - $wgOut->permissionRequired( 'editlangs' ); - return; - } - if( !$wgRequest->wasPosted() || !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { - $wgOut->addWikiMsg( 'sessionfailure' ); - return; - } - $this->doSubmit(); - break; - default: - $this->showList( $admin ); - break; - } + function FormRow( $name, $input ) { + return '<tr>'. + '<td class="mw-label">'.Xml::label( wfMsg( 'wminc-languages-'.$name ), + 'mw-languages-'.$name ).'</td>'. + '<td class="mw-input">'.$input.'</td>'. + '</tr>'; } - function showForm( $action ) { - global $wgRequest, $wgUser; + function showList() { + global $wgOut, $wgLang, $wmincProjectSite, $wmincProjects, $wmincSisterProjects; - $langcode = $wgRequest->getVal( 'lang' ); - $actionUrl = $this->getTitle()->getLocalURL( 'action=submit' ); - $token = $wgUser->editToken(); - - switch( $action ){ - case "delete": - $out = Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', null, wfMsg( 'wminc-languages-deleting-title', $langcode ) ) . - Xml::openElement( 'form', array('id'=> 'mw-languages-deleteform', 'method'=> 'post', 'action' => $actionUrl ) ) . - wfMsgExt( 'wminc-languages-deleting-text', array( 'parseinline' ), $langcode )."\n". - Xml::openElement( 'table' ). - '<tr><td class="mw-label">' . Xml::label( wfMsg( 'deletecomment' ), 'mw-languages-deletereason') . '</td>' . - '<td class="mw-input">' . - Xml::input( 'wpLanguagesReason', 60, NULL, array( 'tabindex' => '1', 'id' => 'mw-languages-deletereason', 'maxlength' => '200' ) ) . - '</td></tr>' . - '<tr><td class="mw-submit">' . Xml::submitButton( wfMsg( 'delete' ), array( 'id' => 'mw-languages-submit' ) ) . - Xml::hidden( 'wpLanguagesCode3', $langcode ) . - Xml::hidden( 'wpLanguagesAction', $action ) . - Xml::hidden( 'wpEditToken', $token ) . - '</td></tr>' . - Xml::closeElement( 'table' ) . - Xml::closeElement( 'form' ) . - Xml::closeElement( 'fieldset' ); - break; - case "edit" : - case "add" : - if( $action == "edit" ){ - $langcode = $wgRequest->getVal( 'lang' ); - $dbr = wfGetDB( DB_SLAVE ); - $row = (object)$dbr->selectRow( 'inc_langs', '*', array( 'code3' => $langcode ) ); - if( !$row ){ - $this->error( 'languages-editerror', $langcode ); - return; - } - $old = Xml::hidden( 'wplanguagesCode3', $row->code3 ); - } + $page = 'MediaWiki:' . $wmincProjectSite['name'] . '-codes'; + $wgOut->addWikiMsg( 'wminc-languages-intro', $page ); - global $wmincLangCodeValidityOptions; - $out = ''; - $out = Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', null, wfMsgExt( 'wminc-languages-intro-add', array( 'parseinline' ) ) ) . - Xml::openElement( 'form', array('id'=> 'mw-languages-editform', 'method'=> 'post', 'action'=>$actionUrl) ) . - Xml::openElement( 'table', array('id'=>'mw-languages-'.$action) ) . - "\n" . - '<tr>' . - '<td class="mw-label">' . - Xml::label( wfMsg( 'wminc-languages-code3' ), 'mw-languages-code3' ) . - '</td>' . - '<td class="mw-input">' . - Xml::input( 'wpLanguagesCode3', 3, (isset($row->code3) ? $row->code3 : ''), - array('id'=>'mw-languages-code3', 'maxlength'=>3) ) . - '</td>' . - '</tr>' . - '<tr>' . - '<td class="mw-label">' . - Xml::label( wfMsg( 'wminc-languages-code1' ), 'mw-languages-code1' ) . - '</td>' . - '<td class="mw-input">' . - Xml::input( 'wpLanguagesCode1', 2, (isset($row->code1) ? $row->code1 : ''), - array('id'=>'mw-languages-code1', 'maxlength'=>2) ) . - '</td>' . - '</tr>' . - '<tr>' . - '<td class="mw-label">' . - Xml::label( wfMsg( 'wminc-languages-name-eng' ), 'mw-languages-eng' ) . - '</td>' . - '<td class="mw-input">' . - Xml::input( 'wpLanguagesEng', 60, (isset($row->eng_name) ?$row->eng_name : ''), - array('id'=>'mw-languages-eng') ) . - '</td>' . - '</tr>' . - '<tr>' . - '<td class="mw-label">' . - Xml::label( wfMsg( 'wminc-languages-name-native' ), 'mw-languages-native' ) . - '</td>' . - '<td class="mw-input">' . - Xml::input( 'wpLanguagesNative', 60, (isset($row->native_name) ? $row->native_name : ''), - array('id'=>'mw-languages-native') ) . - '</td>' . - '</tr>' . - '<tr>' . - '<td class="mw-label">' . - Xml::label( wfMsg( 'wminc-languages-valid' ), 'mw-languages-valid' ) . - '</td>' . - '<td class="mw-input">' . - '<select name="wpLanguagesValid" id="mw-languages-valid">'; - foreach($wmincLangCodeValidityOptions as $option => $desc) { - $out .= '<option value="'.$option.'"'; - if(isset($row->valid) && $row->valid == $option) { $out .= ' selected'; } - $out .= '><i>'.$option.'</i> || '.$desc.'</option>'; - } - $out .= '</select>' . - '</td>' . - '</tr>' . - '<tr>' . - '<td class="mw-label">' . - Xml::label( wfMsg( 'wminc-languages-dir' ), 'mw-languages-dir' ) . - '</td>' . - '<td class="mw-input">' . - Xml::radio( 'wpLanguagesDir', 1, true, array('id'=>'mw-languages-dir') ) . 'LTR' . - Xml::radio( 'wpLanguagesDir', 0, false, array('id'=>'mw-languages-dir') ) . 'RTL' . - '</td>' . - '</tr>' . - '<tr><td class="mw-label">' . Xml::label( wfMsg( 'wminc-languages-reason' ), 'mw-languages-editreason' ) . '</td>' . - '<td class="mw-input">' . Xml::input( 'wpLanguagesReason', 60, NULL, array( 'tabindex'=>'1', 'id'=>'mw-languages-editreason', 'maxlength'=>'200') ) . - Html::hidden( 'wpLanguagesAction', $action ) . - $old . - Html::hidden( 'wpEditToken', $token ) . - '</td></tr>' . - '<tr><td class="mw-submit">' . Xml::submitButton( wfMsg( 'tooltip-save' ), array( 'id'=>'mw-languages-submit' ) ) . '</td></tr>' . - Xml::closeElement( 'table' ) . - Xml::closeElement( 'form' ) . - Xml::closeElement( 'fieldset' ); - break; + $langs = new IncubatorLanguages; + + if ( $langs->getNumber() == 0 ) { + $error = wfMsg( 'wminc-languages-error', $page ); + $wgOut->addHTML( Html::rawElement( 'p', array( 'class' => 'error' ), $error ) ); + return; } - global $wgOut; - $wgOut->addHTML($out); - } - function doSubmit() { - global $wgRequest, $wgOut, $wgLang; - $code3 = $wgRequest->getVal( 'wpLanguagesCode3' ); - $do = $wgRequest->getVal( 'wpLanguagesAction' ); - $reason = $wgRequest->getText( 'wpLanguagesReason' ); - $selfTitle = $this->getTitle(); - $dbw = wfGetDB( DB_MASTER ); - switch( $do ) { - case "delete": - $dbw->delete( 'inc_langs', array( 'code3' => $code3 ), __METHOD__ ); + $out = ''; - if ( $dbw->affectedRows() == 0 ) { - $this->error( 'languages-submit-delfailed', $code3 ); - $this->showForm( $do ); - } else { - $wgOut->addWikiText( - wfMsg( 'wminc-languages-submit-deleted', $code3 ). - ' '. - wfMsg( 'wminc-languages-submit-viewlog' ) ); - $wgOut->returnToMain( false, $selfTitle ); - $log = new LogPage( 'languages' ); - $log->addEntry( 'lang_del', $selfTitle, $reason, array( $code3 ) ); - } - break; - case "edit": - case "add": - $data = array( - 'code1' => $wgRequest->getVal( 'wpLanguagesCode1' ), - 'code3' => $code3, - 'eng_name' => $wgRequest->getText( 'wpLanguagesEng' ), - 'native_name' => $wgRequest->getText( 'wpLanguagesNative' ), - 'valid' => $wgRequest->getVal( 'wpLanguagesValid' ), - 'ltr' => $wgRequest->getVal( 'wpLanguagesDir' ) ? 1 : 0, - ); + $out .= '<table width="100%" class="mw-languagestable wikitable">'; + $out .= Html::rawElement( 'tr', array( 'id' => 'languagestable-header' ), + Html::element( 'th', null, wfMsg( 'wminc-languages-code' ) ) . + Html::element( 'th', null, wfMsg( 'wminc-languages-name-eng' ) ) . + Html::element( 'th', null, wfMsg( 'wminc-languages-name-user' ) ) . + Html::element( 'th', null, wfMsg( 'wminc-languages-name-native' ) ) . + Html::element( 'th', null, wfMsg( 'wminc-languages-script' ) ) . + Html::element( 'th', null, wfMsg( 'wminc-languages-valid' ) ) . + Html::element( 'th', null, wfMsg( 'wminc-languages-projects' ) ) + ); - if( $do == 'add' ) { - $dbw->insert( 'inc_langs', $data, __METHOD__, 'IGNORE' ); - } else { - $dbw->update( 'inc_langs', $data, array( 'code3' => $code3 ), __METHOD__, 'IGNORE' ); + foreach( $langs->mLangsData as $code => $langData ) { + $out .= '<tr class="mw-languagestable-row" id="lang-' . $code . '">'; + $anchorLink = "<a href='#lang-$code' title='#lang-$code'>#</a> "; + $out .= Html::rawElement( 'td', + array( 'style' => 'font-family:monospace,"Courier New";' ), + $anchorLink . $code ); + + if( isset( $langData['lower'] ) ) { + $lower = $langData['lower']; + $lowerLink = "<a href='#lang-$lower' title='#lang-$lower'>$lower</a>"; + $out .= Html::rawElement( 'td', array( 'colspan' => 3, + 'style' => 'font-weight:bold;font-size:110%;' ), + "→ $lowerLink" ); + $out .= "\n</tr>\n"; + continue; } - if( $dbw->affectedRows() == 0 ) { - $this->error( 'wminc-languages-submit-'.$do.'failed', $code3 ); - $this->showForm( $do ); - } else { - $wgOut->addWikiText( - wfMsg( 'wminc-languages-submit-'.$do.'ed', $code3 ). - ' '. - wfMsg( 'wminc-languages-submit-viewlog' ) ); - $wgOut->returnToMain( false, $selfTitle ); - $log = new LogPage( 'languages' ); - $log->addEntry( 'lang_'.$do, $selfTitle, $reason, - array( $code3, $wgLang->commaList($data) ) - ); + $out .= Html::element( 'td', null, $langs->getEnglishName( $code ) ); + $out .= Html::element( 'td', array( 'dir' => $wgLang->getDir() ), $langs->getUserLangName( $code ) ); + $dir = $langs->getDir( $code ); + $out .= Html::element( 'td', array( 'dir' => $dir ), $langs->getNativeName( $code ) ); + $scripts = ''; + if( isset( $langData['script'] ) ) { + $listScripts = explode( ', ', $langData['script'] ); + $scripts = $wgLang->commaList( $listScripts ); } - break; - } - } + $out .= Html::element( 'td', null, $scripts ); - function showList( $admin ) { - global $wgUser, $wgOut, $wgScriptPath; + $validity = isset( $langData['type'] ) ? $langData['type'] : ''; + $out .= Html::element( 'td', null, $validity ); - /*======== FIXME ============ */ - $wgOut->addExtensionStyle( "{$wgScriptPath}/extensions/Interwiki/SpecialInterwiki.css" ); - - $wgOut->addWikiMsg( 'wminc-languages-intro' ); - $selfTitle = $this->getTitle(); - - $links = '<li>'.$wgUser->getSkin()->link( - SpecialPage::getTitleFor( 'Log' ), - wfMsgHtml( 'wminc-languages-intro-log' ), - array(), array( 'type' => 'languages' ) ). - '</li>'; - if ( $admin ) { - $links .= '<li>'. - $wgUser->getSkin()->link( $selfTitle, - wfMsgHtml( 'wminc-languages-intro-add' ), - array(), array( 'action' => 'add' ) ). - '</li>'; - } - $wgOut->addHTML( '<ul>' . $links . '</ul>' ); - - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'inc_langs', '*' ); - $numrows = $res->numRows(); - if ( $numrows == 0 ) { - $this->error( 'languages-error' ); - return; - } - - $out = ' - <table width="100%" class="mw-languagestable wikitable"> - <tr id="languagestable-header"> - <th>'.wfMsgHtml( 'wminc-languages-code3' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-code1' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-name-eng' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-name-native' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-valid' ).'</th> - <th>'.wfMsgHtml( 'wminc-languages-dir' ).'</th>'; - if( $admin ) { - $out .= '<th>'.wfMsgHtml( 'wminc-languages-edit' ).'</th>'; - } - $out .= "</tr>\n"; - - while( $s = $res->fetchObject() ) { - $code3 = htmlspecialchars( $s->code3 ); - $code1 = htmlspecialchars( $s->code1 ); - $valid = htmlspecialchars( $s->valid ); - $name_eng = htmlspecialchars( $s->eng_name ); - $name_native = htmlspecialchars( $s->native_name ); - $ltr = htmlspecialchars( $s->ltr ) ? 'LTR' : 'RTL'; - $out .= '<tr class="mw-languagestable-row"> - <td>'.$code3.'</td> - <td>'.$code1.'</td> - <td>'.$name_eng.'</td> - <td>'.$name_native.'</td> - <td>'.$valid.'</td> - <td>'.$ltr.'</td>'; - if( $admin ) { - $out .= '<td class="mw-languagestable-modify">'; - $out .= $wgUser->getSkin()->link( $selfTitle, wfMsgHtml( 'edit' ), array(), - array( 'action' => 'edit', 'lang' => $s->code3 ) ); - $out .= ', '; - $out .= $wgUser->getSkin()->link( $selfTitle, wfMsgHtml( 'delete' ), array(), - array( 'action' => 'delete', 'lang' => $s->code3 ) ); - $out .= '</td>'; + $listProjects = array(); + foreach( $wmincProjects as $projectcode => $name ) { + $prefix = IncubatorTest::displayPrefix( $projectcode, $code ); + $listProjects[] = Linker::linkKnown( Title::newFromText( $prefix ), 'w' . $projectcode ); } + foreach( $wmincSisterProjects as $projectcode => $name ) { + $prefix = IncubatorTest::displayPrefix( $projectcode, $code, true ); + # TODO: add support for secure server (perhaps make general function) + $url = 'http://' . $code . '.' . strtolower( $name ) . '.org/'; + $listProjects[] = "<a href='$url' title='$url'>w$projectcode</a>"; + } + $listProjects = implode( ' · ', $listProjects ); + $out .= Html::rawElement( 'td', null, $listProjects ); $out .= "\n</tr>\n"; } - $res->free(); $out .= "</table><br />"; $wgOut->addHTML( $out ); } - - function error() { - global $wgOut; - $args = func_get_args(); - $wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args ); - } } Modified: trunk/SpecialRequestWiki.php =================================================================== --- trunk/SpecialRequestWiki.php 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/SpecialRequestWiki.php 2011-07-12 00:40:58 UTC (rev 17) @@ -1,6 +1,6 @@ <?php /** - * + * Special page to request a new subdomain. (experimental) */ class SpecialRequestWiki extends SpecialPage @@ -36,7 +36,7 @@ public function showInfo( $project, $lang ) { global $wgOut, $wmincProjects; $languages = IncubatorTest::getLanguageNames(); - $projectname = array_search( $project, $wmincProjects ); + $projectname = isset( $wmincProjects[$project] ) ? $wmincProjects[$project] : ''; /* Define categories */ $items_cats[0] = 'Criteria for elibility'; $items_cats[1] = 'Criteria for final approval'; Modified: trunk/SpecialViewUserLang.php =================================================================== --- trunk/SpecialViewUserLang.php 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/SpecialViewUserLang.php 2011-07-12 00:40:58 UTC (rev 17) @@ -67,8 +67,7 @@ * @param $target Mixed: user whose language and test wiki we're looking up */ function showInfo( $target ) { - global $wgOut, $wmincPref, $wmincProjectSite, $wgUser; - $sk = $wgUser->getSkin(); + global $wgOut, $wmincPref, $wmincProjectSite; $user = User::newFromName( $target ); $name = $user->getName(); $id = $user->getId(); @@ -78,11 +77,11 @@ $wgOut->addHTML( Xml::span( wfMsg( 'wminc-userdoesnotexist', $target ), 'error' ) ); } else { $userproject = $user->getOption( $wmincPref . '-project' ); - $userproject = ($userproject ? $userproject : 'none'); + $userproject = ( $userproject ? $userproject : 'none' ); $usercode = $user->getOption( $wmincPref . '-code' ); $prefix = IncubatorTest::displayPrefix( $userproject, $usercode ); if ( IncubatorTest::isContentProject( $userproject ) ) { - $testwiki = $sk->link( Title::newFromText( $prefix ) ); + $testwiki = Linker::link( Title::newFromText( $prefix ) ); } elseif ( $prefix == $wmincProjectSite['short'] ) { $testwiki = htmlspecialchars( $wmincProjectSite['name'] ); } else { @@ -91,7 +90,7 @@ $wgOut->addHtml( Xml::openElement( 'ul' ) . '<li>' . wfMsgHtml( 'username' ) . ' ' . - $sk->userLink( $id, $name ) . $sk->userToolLinks( $id, $name, true ) . '</li>' . + Linker::userLink( $id, $name ) . Linker::userToolLinks( $id, $name, true ) . '</li>' . '<li>' . wfMsgHtml( 'loginlanguagelabel', $langNames[$user->getOption( 'language' )] . ' (' . $user->getOption( 'language' ) . ')' ) . '</li>' . '<li>' . wfMsgHtml( 'wminc-testwiki' ) . ' ' . $testwiki . '</li>' . Modified: trunk/TestWikiDB.i18n.php =================================================================== --- trunk/TestWikiDB.i18n.php 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/TestWikiDB.i18n.php 2011-07-12 00:40:58 UTC (rev 17) @@ -12,16 +12,8 @@ * @author Hydriz */ $messages['en'] = array( - 'wminc-languages' => 'Languages', - 'wminc-languages-intro' => 'This is a list of defined languages.', 'wminc-languages-intro-log' => 'View the log', 'wminc-languages-intro-add' => 'Add a new language', - 'wminc-languages-code3' => 'ISO 639-3 code', - 'wminc-languages-code1' => 'ISO 639-1 code', - 'wminc-languages-name-eng' => 'English name', - 'wminc-languages-name-native' => 'Native name', - 'wminc-languages-valid' => 'Code validity', - 'wminc-languages-dir' => 'Directionality', 'wminc-languages-edit' => 'Edit', 'wminc-languages-reason' => 'Reason', 'wminc-languages-log-name' => 'Language list log', Modified: trunk/TestWikiRC.php =================================================================== --- trunk/TestWikiRC.php 2011-07-07 15:51:15 UTC (rev 16) +++ trunk/TestWikiRC.php 2011-07-12 00:40:58 UTC (rev 17) @@ -26,7 +26,7 @@ $conds['rc_namespace'] = $wmincTestWikiNamespaces; $conds[] = 'rc_title ' . $dbr->buildLike( $prefix . '/', $dbr->anyString() ) . ' OR rc_title = ' . $dbr->addQuotes( $prefix ); - } elseif( in_array( $projectvalue, $wmincProjects ) ) { + } elseif( isset( $wmincProjects[$projectvalue] ) ) { // When only a project selected, show all edits in all test wikis of that project $dbr = wfGetDB( DB_SLAVE ); $conds['rc_namespace'] = $wmincTestWikiNamespaces; @@ -48,7 +48,7 @@ $label = Xml::label( wfMsg( 'wminc-testwiki' ), 'rc-testwiki' ); $select = new XmlSelect( 'rc-testwiki-project', 'rc-testwiki-project', $projectvalue ); $select->addOption( wfMsg( 'wminc-testwiki-none' ), 'none' ); - foreach( $wmincProjects as $name => $prefix) { + foreach( $wmincProjects as $prefix => $name ) { $select->addOption( $name, $prefix ); } $select->addOption( $wmincProjectSite['name'], $wmincProjectSite['short'] ); Added: trunk/WikimediaIncubator.dev-i18n.php =================================================================== --- trunk/WikimediaIncubator.dev-i18n.php (rev 0) +++ trunk/WikimediaIncubator.dev-i18n.php 2011-07-12 00:40:58 UTC (rev 17) @@ -0,0 +1,34 @@ +<?php +/** + * Internationalisation file for WikimediaIncubator extension. + * @file + * @ingroup Extensions + */ + +$messages = array(); + +/** English + * @author SPQRobin + * @author Hydriz + */ +$messages['en'] = array( + 'wminc-incubatorexport' => 'Export pages from a test wiki', + 'wminc-requestwiki' => 'Request a new wiki', + + 'wminc-languages' => 'Languages', + 'wminc-languages-intro' => 'This is a list of languages that are defined in [[$1]].', + 'wminc-languages-error' => 'There are no languages defined in [[$1]], or there was another error.', + 'wminc-languages-code' => 'Language code', +# 'wminc-languages-code1' => 'ISO 639-1 code', + 'wminc-languages-code3' => 'ISO 639-3 code', + 'wminc-languages-name-eng' => 'English name', + 'wminc-languages-name-user' => 'Name in your language', + 'wminc-languages-name-native' => 'Native name', + 'wminc-languages-script' => 'Scripts', + 'wminc-languages-valid' => 'Code validity', + 'wminc-languages-projects' => 'Projects', + + 'group-... [truncated message content] |
From: <ro...@us...> - 2011-07-07 15:51:21
|
Revision: 16 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=16&view=rev Author: robin-p Date: 2011-07-07 15:51:15 +0000 (Thu, 07 Jul 2011) Log Message: ----------- * Use # for comments * More work on info pages * Use ResourceLoader for css * Add user group messages Modified Paths: -------------- trunk/IncubatorTest.php trunk/InfoPage.css trunk/InfoPage.php trunk/WikimediaIncubator.i18n.php trunk/WikimediaIncubator.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-06-24 02:19:17 UTC (rev 15) +++ trunk/IncubatorTest.php 2011-07-07 15:51:15 UTC (rev 16) @@ -229,13 +229,13 @@ $prefixdata = self::analyzePrefix( $newtitle->getText() ); $ns = $newtitle->getNamespace(); if( !isset( $prefixdata['error'] ) ) { - // if there is no error with the page title + # if there is no error with the page title return true; } elseif( self::displayPrefix() == $wmincProjectSite['short'] ) { - // If user has "project" as test wiki preference, it isn't needed to check + # If user has "project" as test wiki preference, it isn't needed to check return true; } elseif( !in_array( $ns, $wmincTestWikiNamespaces ) ) { - // OK if it's not in one of the content namespaces + # OK if it's not in one of the content namespaces return true; } // now there should be an error with the new page title @@ -264,6 +264,7 @@ // ########### START DEVELOPMENT STUFF ############# # Make the page content language depend on the test wiki + # Only works for codes that are known to MediaWiki :( static function onPageContentLanguage( $title, &$pageLang ) { global $wmincTestWikiNamespaces; $prefix = IncubatorTest::analyzePrefix( $title, @@ -273,13 +274,13 @@ return true; } if( $prefix['prefix'] == $title->getText() ) { - return true; // Not for info pages (prefix == title) + return true; # Not for info pages (prefix == title) } $pageLang = $prefix['lang']; return true; } - // Missing article on Wx/xx inf pages: show welcome page + # Missing article on Wx/xx inf pages: show welcome page static function onShowMissingArticle( $article ) { $titleObject = $article->mTitle; $prefix = IncubatorTest::analyzePrefix( $titleObject, true ); @@ -292,20 +293,19 @@ return true; } - // When creating a new info page, help the user by prefilling it - // NEED TO IMPROVE THIS + # When creating a new info page, help the user by prefilling it + # NEED TO IMPROVE THIS public static function onEditFormPreloadText( &$text, &$title ) { $pagetitle = $title->getText(); - $ns = $title->getNamespace(); $prefix = IncubatorTest::analyzePrefix( $pagetitle, true /* only info page */ ); - if( isset( $prefix['error'] ) || $ns != NS_MAIN ) { + if( isset( $prefix['error'] ) || $title->getNamespace() != NS_MAIN ) { return true; } global $wgRequest, $wgOut; if ( $wgRequest->getBool( 'redlink' ) ) { - // The edit page was reached via a red link. - // Redirect to the article page and let them click the edit tab if - // they really want to create this info page. + # The edit page was reached via a red link. + # Redirect to the article page and let them click the edit tab if + # they really want to create this info page. $wgOut->redirect( $title->getFullUrl() ); } $text = wfMsgNoTrans( 'wminc-infopage-prefill', $prefix['prefix'] ); @@ -326,7 +326,7 @@ $mainpage='', $created='', $bug='', $since='' ) { global $wgTitle; $prefix = IncubatorTest::analyzePrefix( $wgTitle, true ); - if( isset( $prefix['error'] ) || $ns != NS_MAIN ) { + if( isset( $prefix['error'] ) || $wgTitle->getNamespace() != NS_MAIN ) { return wfMsg( 'wminc-infopage-error' ); } $infopage = new InfoPage( $wgTitle, $prefix ); @@ -366,16 +366,16 @@ */ function fnTestWikiLogo( &$out, &$sk ) { global $wmincTestWikiNamespaces, $wgLogo; - // return if the page is not in one of the test wiki namespaces + # return if the page is not in one of the test wiki namespaces if( !in_array( $out->getTitle()->getNamespace(), (array)$wmincTestWikiNamespaces ) ) { return false; } - // return if the page does not have a valid prefix (info page is valid) + # return if the page does not have a valid prefix (info page is valid) $prefix = IncubatorTest::analyzePrefix( $out->getTitle() ); if( isset( $prefix['error'] ) ) { return false; } - // return if MediaWiki: Incubator-logo-wx/xx(x) does not exists + # return if MediaWiki: Incubator-logo-wx/xx(x) does not exists $pagetitle = Title::makeTitle( NS_MEDIAWIKI, 'Incubator-logo-'.strtolower( $prefix['prefix'] ) ); if( !$pagetitle->exists() ) { return false; Modified: trunk/InfoPage.css =================================================================== --- trunk/InfoPage.css 2011-06-24 02:19:17 UTC (rev 15) +++ trunk/InfoPage.css 2011-07-07 15:51:15 UTC (rev 16) @@ -4,9 +4,8 @@ .infopage-invalidcode { background-color:#FFDBDB; border:2px solid red; } .infopage-open { background-color:#F3F3FF; border:2px solid blue; } .infopage-imported { background-color:#FAF6ED; border:2px solid orange; }*/ -.infopage-title { padding:8px; font-size:180%; } -.infopage-entertest-right { margin-left:1em; } -.infopage-entertest-left { margin-right:1em; } +.wminc-infopage-title { padding:8px; font-size:180%; } +.wminc-infopage-entertest { margin-left:1em; } .noarticletext, .mw-warning-with-logexcerpt, .firstHeading { display: none; /* FIXME: is it possible to hide firstHeading only for non-existing pages? */ } @@ -23,6 +22,5 @@ .wminc-infopage-title { font-size:140%; padding:.3em 0; font-weight:bold; } .wminc-infopage-text { font-size: 125%; } .wminc-infopage-missingwiki-options { padding: .2em; } -.wminc-infopage-logo-right { float: right; } -.wminc-infopage-logo-left { float: left; } +.wminc-infopage-logo { float: right; } .wminc-infopage-createmainpage { margin-left: .5em; font-weight: bold; } \ No newline at end of file Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-06-24 02:19:17 UTC (rev 15) +++ trunk/InfoPage.php 2011-07-07 15:51:15 UTC (rev 16) @@ -17,7 +17,7 @@ if( isset( $prefixdata['error'] ) || $title->getNamespace() != NS_MAIN ) { return; } - global $wgOut, $wgRequest, $wmincScriptDir, $wmincProjects; + global $wgRequest, $wmincScriptDir, $wmincProjects; $this->mPrefix = $prefixdata['prefix']; $this->mLangCode = $prefixdata['lang']; $this->mProjectCode = $prefixdata['project']; @@ -32,7 +32,6 @@ header('Location: '.$wgServer.$wgArticlePath.$this->getMainPage() ); } } - $wgOut->addExtensionStyle( $wmincScriptDir . 'InfoPage.css' ); $this->mLangNames = $this->getLanguageNames(); $this->mLangsData = $this->loadLanguagesData(); $this->mThisLangData = ( isset( $this->mLangsData[$this->mLangCode] ) ? @@ -156,12 +155,13 @@ } public function StandardInfoPage( $beforetitle, $aftertitle, $content ) { - global $wgLang; + global $wgLang, $wgOut, $wmincScriptDir; + $wgOut->addModules( 'WikimediaIncubator.InfoPage' ); return Html::rawElement( 'div', array( 'class' => 'wminc-infopage plainlinks', - 'lang' => $wgLang->getCode(), 'dir' => wfUILang()->getDir() ), + 'lang' => $wgLang->getCode(), 'dir' => $wgLang->getDir() ), $beforetitle . - Html::rawElement( 'div', array( 'class' => 'wminc-infopage-logo wminc-infopage-logo-' . - wfUILang()->AlignEnd() ), $this->makeLogo( $this->mProjectName, true, 175 ) + Html::rawElement( 'div', array( 'class' => 'wminc-infopage-logo' ), + $this->makeLogo( $this->mProjectName, true, 175 ) ) . Html::rawElement( 'div', array( 'class' => 'wminc-infopage-title' ), wfMsg( 'wminc-infopage-title', $this->mProjectName, $this->mLangName ) . @@ -190,7 +190,7 @@ $bug = isset( $this->mBug ) ? $this->mBug : ''; if( $this->mThisLangData['type'] != 'invalid' ) { $gotoMainPage = Html::rawElement( 'span', - array( 'class' => 'wminc-infopage-entertest infopage-entertest-' . wfUILang()->AlignEnd() ), + array( 'class' => 'wminc-infopage-entertest' ), '→ ' . $wgUser->getSkin()->link( Title::newFromText( $this->getMainPage() ), wfMsgNoTrans( 'wminc-infopage-enter' ) ) ); } @@ -209,7 +209,7 @@ $bug = isset( $this->mBug ) ? $this->mBug : ''; if( $this->mThisLangData['type'] != 'invalid' ) { $gotoSubdomain = Html::rawElement( 'span', - array( 'class' => 'wminc-infopage-entertest infopage-entertest-' . wfUILang()->AlignEnd() ), + array( 'class' => 'wminc-infopage-entertest' ), '→ <a href="' . $this->getSubdomain() . '">' . $this->getSubdomain( '', false ). '</a>' ); } @@ -218,7 +218,7 @@ if( $status != 'approved' && $this->mThisLangData['type'] != 'invalid' ) { $content .= Html::element( 'div', array( 'class' => 'wminc-infopage-contribute' ), wfMsg( 'wminc-infopage-contribute' ) ); } - $content .= wfMsg( 'infopage-text-' . $status, array( $status, 'Lol!', '', $bug ) ); + $content .= wfMsg( 'wminc-infopage-text-' . $status, array( $status, 'Lol!', '', $bug ) ); return $this->StandardInfoPage( '', $gotoSubdomain, $content ); } } \ No newline at end of file Modified: trunk/WikimediaIncubator.i18n.php =================================================================== --- trunk/WikimediaIncubator.i18n.php 2011-06-24 02:19:17 UTC (rev 15) +++ trunk/WikimediaIncubator.i18n.php 2011-07-07 15:51:15 UTC (rev 16) @@ -33,6 +33,10 @@ 'wminc-recentchanges-all' => 'All recent changes', 'wminc-incubatorexport' => 'Export pages from a test wiki', 'wminc-requestwiki' => 'Request a new wiki', + + 'group-test-sysop' => 'Local administrators', + 'group-test-sysop-member' => 'local administrator', + 'grouppage-test-sysop' => 'Project:Local administrators', ); /** Message documentation (Message documentation) Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-06-24 02:19:17 UTC (rev 15) +++ trunk/WikimediaIncubator.php 2011-07-07 15:51:15 UTC (rev 16) @@ -65,6 +65,12 @@ $wgExtensionMessagesFiles['WikimediaIncubator'] = $dir . 'WikimediaIncubator.i18n.php'; +$wgResourceModules['WikimediaIncubator.InfoPage'] = array( + 'styles' => 'InfoPage.css', + 'localBasePath' => dirname(__FILE__), + 'remoteExtPath' => $wmincScriptDir, +); + /* Special:ViewUserLang */ $wgAutoloadClasses['SpecialViewUserLang'] = $dir . 'SpecialViewUserLang.php'; $wgSpecialPages['ViewUserLang'] = 'SpecialViewUserLang'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-06-24 02:19:23
|
Revision: 15 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=15&view=rev Author: robin-p Date: 2011-06-24 02:19:17 +0000 (Fri, 24 Jun 2011) Log Message: ----------- * Further work on info page * Recent changes: when only a project selected, show all edits in all test wikis of that project * Use hook before it even exists :p (I plan to add it): it sets the page content language according to the test wiki of that page (good for RTL languages: automatic RTL alignment) Modified Paths: -------------- trunk/IncubatorTest.php trunk/InfoPage.css trunk/InfoPage.i18n.php trunk/InfoPage.php trunk/TestWikiRC.php trunk/WikimediaIncubator.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-06-23 00:34:40 UTC (rev 14) +++ trunk/IncubatorTest.php 2011-06-24 02:19:17 UTC (rev 15) @@ -66,10 +66,10 @@ * Use validatePrefix() if you just want true or false. * Use displayPrefixedTitle() to make a prefix page title! * - * @param $onlyprefix Bool Whether to validate only the prefix, or + * @param $onlyInfoPage Bool Whether to validate only the prefix, or * also allow other text within the page title (Wx/xxx vs Wx/xxx/Text) */ - static function analyzePrefix( $title, $onlyprefix = false ) { + static function analyzePrefix( $title, $onlyInfoPage = false ) { $data = array(); // split title into parts $titleparts = explode( '/', $title ); @@ -87,10 +87,10 @@ global $wmincProjects; $listProjects = implode( '', $wmincProjects ); // something like: pbtqn if( !preg_match( '/^W['.$listProjects.']\/[a-z-]+' . - ($onlyprefix ? '$/' : '(\/.+)?$/' ), $title ) ) { + ($onlyInfoPage ? '$/' : '(\/.+)?$/' ), $title ) ) { $data['error'] = 'invalidprefix'; } - if( !$onlyprefix && ( isset( $data['error'] ) && + if( !$onlyInfoPage && ( isset( $data['error'] ) && $data['error'] != 'invalidprefix' ) ) { // there is a Page_title $prefixn = strlen( $data['prefix'].'/' ); // number of chars in prefix // get Page_title from Wx/xx/Page_title @@ -263,10 +263,30 @@ // ########### START DEVELOPMENT STUFF ############# + # Make the page content language depend on the test wiki + static function onPageContentLanguage( $title, &$pageLang ) { + global $wmincTestWikiNamespaces; + $prefix = IncubatorTest::analyzePrefix( $title, + /* onlyInfoPage*/ false, /* noInfoPage */ true ); + if( isset( $prefix['error'] ) || !in_array( $title->getNamespace(), + $wmincTestWikiNamespaces ) ) { + return true; + } + if( $prefix['prefix'] == $title->getText() ) { + return true; // Not for info pages (prefix == title) + } + $pageLang = $prefix['lang']; + return true; + } + // Missing article on Wx/xx inf pages: show welcome page static function onShowMissingArticle( $article ) { $titleObject = $article->mTitle; - $infopage = new InfoPage( $titleObject ); + $prefix = IncubatorTest::analyzePrefix( $titleObject, true ); + if( isset( $prefix['error'] ) ) { + return true; + } + $infopage = new InfoPage( $titleObject, $prefix ); global $wgOut; $wgOut->addHtml( $infopage->showMissingWiki() ); return true; @@ -293,7 +313,7 @@ } public static function onParserFirstCallInit( &$parser ) { - $parser->setFunctionHook( 'infopage', 'IncubatorTest::render' ); + $parser->setFunctionHook( 'infopage', 'IncubatorTest::renderParserFunction' ); return true; } @@ -302,17 +322,24 @@ return true; } - public static function render( &$parser, $status='default', $meta=false, + public static function renderParserFunction( &$parser, $status='default', $meta=false, $mainpage='', $created='', $bug='', $since='' ) { global $wgTitle; - $infopage = new InfoPage( $wgTitle ); + $prefix = IncubatorTest::analyzePrefix( $wgTitle, true ); + if( isset( $prefix['error'] ) || $ns != NS_MAIN ) { + return wfMsg( 'wminc-infopage-error' ); + } + $infopage = new InfoPage( $wgTitle, $prefix ); if( $status ) { $infopage->mStatus = $status; } if( $meta ) { $infopage->mMeta = $meta; } if( $mainpage ) { $infopage->mMainPage = $mainpage; } if( $created ) { $infopage->mCreated = $created; } if( $bug ) { $infopage->mBug = $bug; } if( $since ) { $infopage->mSince = $since; } - return $infopage->showIncubatingWiki(); + if( in_array( $status, array( 'created', 'beforeincubator' ) ) ) { + return array( $infopage->showExistingWiki(), 'isHTML' => true ); + } + return array( $infopage->showIncubatingWiki(), 'isHTML' => true ); } /* Modified: trunk/InfoPage.css =================================================================== --- trunk/InfoPage.css 2011-06-23 00:34:40 UTC (rev 14) +++ trunk/InfoPage.css 2011-06-24 02:19:17 UTC (rev 15) @@ -5,13 +5,8 @@ .infopage-open { background-color:#F3F3FF; border:2px solid blue; } .infopage-imported { background-color:#FAF6ED; border:2px solid orange; }*/ .infopage-title { padding:8px; font-size:180%; } -.infopage-entertest { - font-size:150%; /*border:2px solid; padding:.5em 1em; - color:#000; border-color:green; background-color:#dfd;*/ - margin-right:15px; margin-top:5px; -} -.infopage-entertest-right { float: right; } -.infopage-entertest-left { float: left; } +.infopage-entertest-right { margin-left:1em; } +.infopage-entertest-left { margin-right:1em; } .noarticletext, .mw-warning-with-logexcerpt, .firstHeading { display: none; /* FIXME: is it possible to hide firstHeading only for non-existing pages? */ } Modified: trunk/InfoPage.i18n.php =================================================================== --- trunk/InfoPage.i18n.php 2011-06-23 00:34:40 UTC (rev 14) +++ trunk/InfoPage.i18n.php 2011-06-24 02:19:17 UTC (rev 15) @@ -11,10 +11,10 @@ * @author SPQRobin */ $messages['en'] = array( - 'testwiki-enter' => 'Go to the Main Page', - 'testwiki-title-open' => 'This is an open wiki', - 'testwiki-text-open' => 'This is an open wiki', - 'testwiki-requirements' => 'Requirements', + 'wminc-infopage-enter' => 'go to the Main Page', + 'wminc-infopage-title-open' => 'This is an open wiki', + 'wminc-infopage-text-open' => 'This is an open wiki', + 'wminc-infopage-requirements' => 'Requirements', 'wminc-unknownlang' => '(unknown language with code "$1")', 'wminc-logo-wikipedia' => 'Wikipedia-logo-v2-en.svg', 'wminc-logo-wiktionary' => 'Wiktionary-logo-en.svg', @@ -37,7 +37,7 @@ * You can search for existing projects in this language: $4 * You can go to a multilingual wiki: $5', 'wminc-infopage-createmainpage' => 'Enter the word "Main Page" in this language:', - 'wminc-infopage-prefill' => '{{#nfopage:open}}', # need to improve this! + 'wminc-infopage-prefill' => '{{#infopage:open}}', # need to improve this! 'wminc-infopage-contribute' => 'If you know this language, you are encouraged to contribute!', ); Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-06-23 00:34:40 UTC (rev 14) +++ trunk/InfoPage.php 2011-06-24 02:19:17 UTC (rev 15) @@ -13,29 +13,33 @@ */ // This class is used for "Wx/xx(x)" pages class InfoPage { - public function __construct( $title ) { - $prefixdata = IncubatorTest::analyzePrefix( $title, true ); - $ns = $title->getNamespace(); - if( isset( $prefixdata['error'] ) || $ns != NS_MAIN ) { + public function __construct( $title, $prefixdata ) { + if( isset( $prefixdata['error'] ) || $title->getNamespace() != NS_MAIN ) { return; } global $wgOut, $wgRequest, $wmincScriptDir, $wmincProjects; $this->mPrefix = $prefixdata['prefix']; $this->mLangCode = $prefixdata['lang']; - $this->mProject = $prefixdata['project']; - $this->mProjectName = array_search( $this->mProject, $wmincProjects); + $this->mProjectCode = $prefixdata['project']; + $this->mProjectName = array_search( $this->mProjectCode, $wmincProjects); // Redirect to real main page if URL is Wx/xxx?goto=mainpage - if($wgRequest->getVal('goto') == 'mainpage' && $mainpage) { + if($wgRequest->getVal('goto') == 'mainpage') { // need to find a proper way global $wgServer, $wgArticlePath; - header('Location: '.$wgServer.$wgArticlePath.$mainpage); + if( $this->mSubdomain == true ) { + header('Location: '.$this->getMainPage() ); + } else { + header('Location: '.$wgServer.$wgArticlePath.$this->getMainPage() ); + } } $wgOut->addExtensionStyle( $wmincScriptDir . 'InfoPage.css' ); $this->mLangNames = $this->getLanguageNames(); $this->mLangsData = $this->loadLanguagesData(); - $this->mThisLangData = (isset( $this->mLangsData[$this->mLangCode] ) ? $this->mLangsData[$this->mLangCode] : ''); + $this->mThisLangData = ( isset( $this->mLangsData[$this->mLangCode] ) ? + $this->mLangsData[$this->mLangCode] : array( 'type' => 'open' ) ); $this->mLangName = ( isset( $this->mLangNames[$this->mLangCode] ) ? $this->mLangNames[$this->mLangCode] : wfMsg( 'wminc-unknownlang', $this->mLangCode ) ); + return; } public function getLanguageNames( $code = '' ) { @@ -108,9 +112,9 @@ $otherProjects = $wmincProjects + $wmincSisterProjects; foreach($otherProjects as $name => $code) { $listOtherProjects[$code] = '<li>' . $this->makeLogo( $name, true, - 75, NULL, 'http://'.$this->mLangCode.'.'.$name.'.org/' ) . '</li>'; + 75, NULL, $this->getSubdomain( $name ) ) . '</li>'; } - unset($listOtherProjects[$this->mProject]); + unset($listOtherProjects[$this->mProjectCode]); return '<ul class="wminc-infopage-otherprojects">' . implode( '', $listOtherProjects ) . '</ul>'; } @@ -124,8 +128,14 @@ } return '<ul class="wminc-infopage-multilingualprojects">' . implode( '', $list ) . '</ul>'; -} + } + // TODO: add support for secure server? + public function getSubdomain( $project = '', $protocol = true ) { + return ( $protocol ? 'http://' : '') . $this->mLangCode . '.' . + strtolower( $project ? $project : $this->mProjectName ) . '.org'; + } + // make "Wx/xxx/Main Page" public function getMainPage( $withprefix = true ) { // Get the provided value, otherwise take the "mainpage" msg @@ -145,7 +155,7 @@ ); } - public function StandardInfoPage( $beforetitle, $aftertitle ) { + public function StandardInfoPage( $beforetitle, $aftertitle, $content ) { global $wgLang; return Html::rawElement( 'div', array( 'class' => 'wminc-infopage plainlinks', 'lang' => $wgLang->getCode(), 'dir' => wfUILang()->getDir() ), @@ -154,8 +164,9 @@ wfUILang()->AlignEnd() ), $this->makeLogo( $this->mProjectName, true, 175 ) ) . Html::rawElement( 'div', array( 'class' => 'wminc-infopage-title' ), - wfMsgWikiHtml( 'wminc-infopage-title', $this->mProjectName, $this->mLangName ) - ) . $aftertitle ); + wfMsg( 'wminc-infopage-title', $this->mProjectName, $this->mLangName ) . + $aftertitle ) . + $content ); } public function showMissingWiki() { @@ -170,29 +181,44 @@ '<br />' . $this->CreateMainPage() : ''), $this->listOtherProjects(), $this->listMultilingualProjects() ) ); - return $this->StandardInfoPage( $welcome, $content ); + return $this->StandardInfoPage( $welcome, '', $content ); } public function showIncubatingWiki() { + global $wgUser; $status = $this->mStatus; $bug = isset( $this->mBug ) ? $this->mBug : ''; - $created = isset( $this->mCreated ) ? $this->mCreated : ''; - $out = ''; - if( !in_array( $status, array( 'approved', 'tocreate' ) ) && $this->mThisLangData['type'] != 'invalid' ) { - $out .= '<div class="infopage-entertest infopage-entertest-' . wfUILang()->AlignEnd() . - '">→ [['. $this->getMainPage() . '|' . wfMsgNoTrans( 'infopage-enter' ) . ']]</div>'; + if( $this->mThisLangData['type'] != 'invalid' ) { + $gotoMainPage = Html::rawElement( 'span', + array( 'class' => 'wminc-infopage-entertest infopage-entertest-' . wfUILang()->AlignEnd() ), + '→ ' . $wgUser->getSkin()->link( Title::newFromText( $this->getMainPage() ), + wfMsgNoTrans( 'wminc-infopage-enter' ) ) ); } - $out .= '<div class="infopage-title">' . wfMsg( 'infopage-title-' . $status ) . '</div>'; + $content = ''; + $content .= Html::element( 'div', array( 'class' => 'wminc-infopage-status' ), wfMsg( 'wminc-infopage-status-' . $status ) ); if( $status != 'approved' && $this->mThisLangData['type'] != 'invalid' ) { - $out .= '<div colspan="4" style="padding-left:3em;"><i>'.wfMsg( 'infopage-contribute' ).'</i></div>'; + $content .= Html::element( 'div', array( 'class' => 'wminc-infopage-contribute' ), wfMsg( 'wminc-infopage-contribute' ) ); } - $out .= wfMsg( 'infopage-text-' . $status, array( $status, 'Lol!', $created, $bug ) ); - $content = ''; - return '<div dir="' . wfUILang()->getDir() . '" class="infopage infopage-' . $status . - '" id="infopage" cellpadding="5">' . $out . '</div>' . $this->StandardInfoPage( '', $content ); + $content .= wfMsg( 'wminc-infopage-text-' . $status, array( $status, 'Lol!', '', $bug ) ); + return $this->StandardInfoPage( '', $gotoMainPage, $content ); } public function showExistingWiki() { - return ''; + $created = isset( $this->mCreated ) ? $this->mCreated : ''; + $status = $this->mStatus; + $bug = isset( $this->mBug ) ? $this->mBug : ''; + if( $this->mThisLangData['type'] != 'invalid' ) { + $gotoSubdomain = Html::rawElement( 'span', + array( 'class' => 'wminc-infopage-entertest infopage-entertest-' . wfUILang()->AlignEnd() ), + '→ <a href="' . $this->getSubdomain() . '">' + . $this->getSubdomain( '', false ). '</a>' ); + } + $content = ''; + $content .= Html::element( 'div', array( 'class' => 'wminc-infopage-status' ), wfMsg( 'wminc-infopage-status-' . $status ) ); + if( $status != 'approved' && $this->mThisLangData['type'] != 'invalid' ) { + $content .= Html::element( 'div', array( 'class' => 'wminc-infopage-contribute' ), wfMsg( 'wminc-infopage-contribute' ) ); + } + $content .= wfMsg( 'infopage-text-' . $status, array( $status, 'Lol!', '', $bug ) ); + return $this->StandardInfoPage( '', $gotoSubdomain, $content ); } } \ No newline at end of file Modified: trunk/TestWikiRC.php =================================================================== --- trunk/TestWikiRC.php 2011-06-23 00:34:40 UTC (rev 14) +++ trunk/TestWikiRC.php 2011-06-24 02:19:17 UTC (rev 15) @@ -5,7 +5,7 @@ class TestWikiRC { static function onRcQuery( &$conds, &$tables, &$join_conds, $opts ) { - global $wgUser, $wgRequest, $wmincPref, $wmincProjectSite, $wmincTestWikiNamespaces; + global $wgUser, $wgRequest, $wmincPref, $wmincProjectSite, $wmincProjects, $wmincTestWikiNamespaces; $projectvalue = strtolower( $wgRequest->getVal( 'rc-testwiki-project', $wgUser->getOption($wmincPref . '-project') ) ); $codevalue = strtolower( $wgRequest->getVal( 'rc-testwiki-code', $wgUser->getOption($wmincPref . '-code') ) ); $prefix = IncubatorTest::displayPrefix( $projectvalue, $codevalue ); @@ -26,6 +26,12 @@ $conds['rc_namespace'] = $wmincTestWikiNamespaces; $conds[] = 'rc_title ' . $dbr->buildLike( $prefix . '/', $dbr->anyString() ) . ' OR rc_title = ' . $dbr->addQuotes( $prefix ); + } elseif( in_array( $projectvalue, $wmincProjects ) ) { + // When only a project selected, show all edits in all test wikis of that project + $dbr = wfGetDB( DB_SLAVE ); + $conds['rc_namespace'] = $wmincTestWikiNamespaces; + $conds[] = 'rc_title ' . $dbr->buildLike( 'W' . $projectvalue . '/', $dbr->anyString() ) . + ' OR rc_title ' . $dbr->buildLike( 'W' . $projectvalue ); } else { return true; } Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-06-23 00:34:40 UTC (rev 14) +++ trunk/WikimediaIncubator.php 2011-06-24 02:19:17 UTC (rev 15) @@ -133,6 +133,7 @@ $wgSpecialPages['RequestWiki'] = 'SpecialRequestWiki'; /* Test wiki pages */ +$wgHooks['PageContentLanguage'][] = 'IncubatorTest::onPageContentLanguage'; # RELATIVELY STABLE FEATURE # $wgHooks['ArticleSave'][] = 'IncubatorTest::onArticleSave'; # The following probably won't work, it can break database stuff that relies on links as they are in the DB # $wgHooks['InternalParseBeforeLinks'][] = 'IncubatorTest::onInternalParseBeforeLinks'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-06-23 00:34:48
|
Revision: 14 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=14&view=rev Author: robin-p Date: 2011-06-23 00:34:40 +0000 (Thu, 23 Jun 2011) Log Message: ----------- Major rewrite/update for InfoPage Modified Paths: -------------- trunk/IncubatorTest.php trunk/InfoPage.css trunk/InfoPage.i18n.php trunk/InfoPage.php trunk/WikimediaIncubator.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-06-21 15:23:07 UTC (rev 13) +++ trunk/IncubatorTest.php 2011-06-23 00:34:40 UTC (rev 14) @@ -262,124 +262,22 @@ } // ########### START DEVELOPMENT STUFF ############# - - function onArticleSave (&$article, &$user, &$text) { - $prefixdata = self::analyzePrefix( $article->getTitle() ); - /*if( isset( $prefixdata['error'] ) ) { - return false; - }*/ - $replaces = array( - '/whoops/' => 'de test werkt', - '/\[\[([^\/\|\]:]+(\|[^\/\]\|:]+))\]\]/U' => '[['.$prefixdata['prefix'].'$1|$1]]', - ); - //preg_replace( array_keys($replaces), array_values($replaces), $text); - preg_replace( '/whoops/', 'de test werkt', $text); - return true; - } - /* UNLIKELY TO WORK WELL: BREAKS LINKS IN DB - function onInternalParseBeforeLinks( &$parser, &$text ) { - $title = $parser->getTitle(); - $prefixdata = self::analyzePrefix( $title ); // prefix "Wx/xx[x]/" - if( isset( $prefixdata['error'] ) ) { - return true; // if there is no prefix (no test wiki page), don't change links - } - $prefix = $prefixdata['prefix']; - $replaces = array( - # '/\[\[(.+)\|(.+)\]\]/U' => '[[$1|$2]]', # doesn't do anything (?) - # '/\[\[Category:(.*)\]\]/U' => '[[Category:'.$prefix.'$1]]', # doesn't do anything (?) - # '/\[\[Template:(.*)\]\]/U' => '[[Template:'.$prefix.'$1]]', # doesn't do anything (?) - # '/{{:(.*)}}/U' => '{{'.$prefix.'/$1}}', # doesn't do anything (?) - # '/\[\[((.*):(.*))\]\]/U' => '[['.$prefix.'$1|$2]]', # experimenting - # '/\[\[(.*[^\|:].*)\]\]/U' => '[['.$prefix.'$1]]', # works, but not really as i want - ); - $textReplaced = preg_replace( array_keys($replaces), array_values($replaces), $text); - $text = $textReplaced; + // Missing article on Wx/xx inf pages: show welcome page + static function onShowMissingArticle( $article ) { + $titleObject = $article->mTitle; + $infopage = new InfoPage( $titleObject ); + global $wgOut; + $wgOut->addHtml( $infopage->showMissingWiki() ); return true; - }*/ - - static function getLanguageNames( $code = '' ) { - // get data from CLDR extension if possible - if ( is_callable( array( 'LanguageNames', 'getNames' ) ) ) { - global $wgLang; - $langcode = ( $code ? $code : $wgLang->getCode() ); - return LanguageNames::getNames( $langcode, - LanguageNames::FALLBACK_NORMAL, - LanguageNames::LIST_MW_AND_CLDR - ); - } - // If we need to display something, use this as fallback - return Language::getLanguageNames( false ); } - // Small convenience function to display a (clickable) logo - function makeLogo( $project, $clickable = true, $width = 25, $height = '', $url = '', $args = '' ) { - $imageobj = wfFindFile( wfMsg( 'wminc-logo-' . strtolower( $project ) ) ); - if ( $imageobj ) { - $thumb = $imageobj->transform( array( 'width' => $width ) ); - $logo = '<img src="' . $thumb->getUrl() . - '" title="'.$project.'" alt="'.$project. - '" width="'.$width.'" height="'.$height.'" '.$args.' />'; - } else { - $logo = $project; // image not found - } - if( $clickable ) { - $useurl = ($url ? $url : 'http://www.'.strtolower( $project ).'.org/'); - return '<a href="'.$useurl.'" title="'.$project.'">'.$logo.'</a>'; - } else { - return $logo; - } - } - - function onShowMissingArticle( $article ) { - // If it is not on Wx/xxx info page (main namespace), do nothing special - $title = $article->mTitle->getText(); - $ns = $article->mTitle->getNamespace(); - $prefixdata = self::analyzePrefix( $title, true ); - if( isset( $prefixdata['error'] ) || $ns != NS_MAIN ) { - return true; - } - global $wgOut, $wmincProjects, $wgNames, $wmincSisterProjects, $wmincScriptDir; - $wgOut->addExtensionStyle( $wmincScriptDir.'InfoPage.css' ); // URGENT FIXME, unable to load CSS file unless forced in MediaWiki:Common.css - $languages = self::getLanguageNames(); - $projectcode = $prefixdata['project']; - $langcode = $prefixdata['lang']; - $project = array_search( $projectcode, $wmincProjects ); - $langname = ( isset( $languages[$langcode] ) ? $languages[$langcode] : wfMsg( 'wminc-unknownlang', $langcode ) ); - $otherProjects = $wmincProjects + $wmincSisterProjects; - foreach($otherProjects as $name => $code) { - $listOtherProjects[$code] = '<li>' . self::makeLogo( $name, true, 75, NULL, - 'http://'.$langcode.'.'.$name.'.org/') . '</li>'; - } - unset($listOtherProjects[$projectcode]); - $ulListOtherProjects = '<ul class="wminc-infopage-tocreate-otherprojects">' . - implode( '', $listOtherProjects ) . '</ul>'; - // Build the 'tocreate' portal - $wgOut->addHtml( - '<div class="wminc-infopage-tocreate plainlinks"> - <div class="wminc-infopage-tocreate-welcome">' . - wfMsgWikiHtml( 'wminc-infopage-tocreate-welcome' ) . - '</div> - <div style="float:right;">' . - self::makeLogo( $project, true, 175) . - '</div> - <div class="wminc-infopage-tocreate-title">' . $project . ' ' . $langname . '</div> - <div class="wminc-infopage-tocreate-text">' . - wfMsgWikiHtml( 'wminc-infopage-tocreate-text', $project, $langname ) . - '</div> - <ul class="wminc-infopage-tocreate-options">' . - wfMsgWikiHtml( 'wminc-infopage-tocreate-options', $project, $langname, - $ulListOtherProjects ) . - '</ul> - </div>' - ); - return true; - } - - function onEditFormPreloadText( &$text, &$title ) { + // When creating a new info page, help the user by prefilling it + // NEED TO IMPROVE THIS + public static function onEditFormPreloadText( &$text, &$title ) { $pagetitle = $title->getText(); $ns = $title->getNamespace(); - $prefix = self::analyzePrefix( $pagetitle, true /* only info page */ ); + $prefix = IncubatorTest::analyzePrefix( $pagetitle, true /* only info page */ ); if( isset( $prefix['error'] ) || $ns != NS_MAIN ) { return true; } @@ -394,9 +292,50 @@ return true; } + public static function onParserFirstCallInit( &$parser ) { + $parser->setFunctionHook( 'infopage', 'IncubatorTest::render' ); + return true; + } + + public static function onGetMagic( &$magicWords, $langCode ) { + $magicWords['infopage'] = array( 0, 'infopage' ); + return true; + } + + public static function render( &$parser, $status='default', $meta=false, + $mainpage='', $created='', $bug='', $since='' ) { + global $wgTitle; + $infopage = new InfoPage( $wgTitle ); + if( $status ) { $infopage->mStatus = $status; } + if( $meta ) { $infopage->mMeta = $meta; } + if( $mainpage ) { $infopage->mMainPage = $mainpage; } + if( $created ) { $infopage->mCreated = $created; } + if( $bug ) { $infopage->mBug = $bug; } + if( $since ) { $infopage->mSince = $since; } + return $infopage->showIncubatingWiki(); + } + /* + * If we can get this to work perfectly, it can replace the AddPrefix gadget + * (I'm not so experienced with regex..) + */ + function onArticleSave (&$article, &$user, &$text) { + $prefixdata = self::analyzePrefix( $article->getTitle() ); + /*if( isset( $prefixdata['error'] ) ) { + return false; + }*/ + $replaces = array( + '/whoops/' => 'de test werkt', + '/\[\[([^\/\|\]:]+(\|[^\/\]\|:]+))\]\]/U' => '[['.$prefixdata['prefix'].'$1|$1]]', + ); + //preg_replace( array_keys($replaces), array_values($replaces), $text); + preg_replace( '/whoops/', 'de test werkt', $text); + return true; + } + + /* * Display a different logo in current test wiki - * if it is set in MediaWiki:Testwiki-logo-wx/xxx + * if it is set in MediaWiki:Incubator-logo-wx/xxx */ function fnTestWikiLogo( &$out, &$sk ) { global $wmincTestWikiNamespaces, $wgLogo; @@ -409,8 +348,8 @@ if( isset( $prefix['error'] ) ) { return false; } - // return if MediaWiki:Testwiki-logo-wx/xx(x) does not exists - $pagetitle = Title::makeTitle( NS_MEDIAWIKI, 'Testwiki-logo-'.strtolower( $prefix['prefix'] ) ); + // return if MediaWiki: Incubator-logo-wx/xx(x) does not exists + $pagetitle = Title::makeTitle( NS_MEDIAWIKI, 'Incubator-logo-'.strtolower( $prefix['prefix'] ) ); if( !$pagetitle->exists() ) { return false; } Modified: trunk/InfoPage.css =================================================================== --- trunk/InfoPage.css 2011-06-21 15:23:07 UTC (rev 13) +++ trunk/InfoPage.css 2011-06-23 00:34:40 UTC (rev 14) @@ -1,42 +1,33 @@ -.testwiki { margin:5px; width:100%; } -.testwiki-default { background-color:#FCFCFC; border:2px solid silver; } -.testwiki-tocreate { background-color:#FCFCFC; border:2px solid silver; } -.testwiki-approved { background-color:#F3FFF3; border:2px solid green; } -.testwiki-invalidcode { background-color:#FFDBDB; border:2px solid red; } -.testwiki-open { background-color:#F3F3FF; border:2px solid blue; } -.testwiki-imported { background-color:#FAF6ED; border:2px solid orange; } -.testwiki-title { padding:8px; font-size:180%; } -.testwiki-entertest { - font-size:150%; border:2px solid; padding:.5em 1em; - color:#000; border-color:green; background-color:#dfd; - margin-right:15px; margin-top:5px; float:right; +/*.infopage-default { background-color:#FCFCFC; border:2px solid silver; } +.infopage-tocreate { background-color:#FCFCFC; border:2px solid silver; } +.infopage-approved { background-color:#F3FFF3; border:2px solid green; } +.infopage-invalidcode { background-color:#FFDBDB; border:2px solid red; } +.infopage-open { background-color:#F3F3FF; border:2px solid blue; } +.infopage-imported { background-color:#FAF6ED; border:2px solid orange; }*/ +.infopage-title { padding:8px; font-size:180%; } +.infopage-entertest { + font-size:150%; /*border:2px solid; padding:.5em 1em; + color:#000; border-color:green; background-color:#dfd;*/ + margin-right:15px; margin-top:5px; } +.infopage-entertest-right { float: right; } +.infopage-entertest-left { float: left; } .noarticletext, .mw-warning-with-logexcerpt, .firstHeading { display: none; /* FIXME: is it possible to hide firstHeading only for non-existing pages? */ } -.wminc-infopage-tocreate { +.wminc-infopage { font-size: 125%; font-family: 'Lucida Sans', Verdana, sans-serif; padding: .6em; margin: .5em 0; } -.wminc-infopage-tocreate li { - padding:.2em 0; -} -.wminc-infopage-tocreate-welcome { - font-style: italic; -} -ul.wminc-infopage-tocreate-otherprojects { - list-style: none; -} -.wminc-infopage-tocreate-otherprojects li { - display: inline; padding:.5em; -} -.wminc-infopage-tocreate-title { - font-size:140%; padding:.3em 0; font-weight:bold; -} -.wminc-infopage-tocreate-text { - font-size: 125%; -} -.wminc-infopage-tocreate-options { - padding: .2em; -} \ No newline at end of file +.wminc-infopage p { margin: .2em 0 .3em; } +.wminc-infopage li { padding:.2em 0 .3em; } +.wminc-infopage-missingwiki-welcome { font-style: italic; } +ul.wminc-infopage-otherprojects, ul.wminc-infopage-multilingualprojects { list-style: none; } +.wminc-infopage-otherprojects li, .wminc-infopage-multilingualprojects li { display: inline; padding:.5em; } +.wminc-infopage-title { font-size:140%; padding:.3em 0; font-weight:bold; } +.wminc-infopage-text { font-size: 125%; } +.wminc-infopage-missingwiki-options { padding: .2em; } +.wminc-infopage-logo-right { float: right; } +.wminc-infopage-logo-left { float: left; } +.wminc-infopage-createmainpage { margin-left: .5em; font-weight: bold; } \ No newline at end of file Modified: trunk/InfoPage.i18n.php =================================================================== --- trunk/InfoPage.i18n.php 2011-06-21 15:23:07 UTC (rev 13) +++ trunk/InfoPage.i18n.php 2011-06-23 00:34:40 UTC (rev 14) @@ -11,39 +11,33 @@ * @author SPQRobin */ $messages['en'] = array( - 'testwiki-enter' => 'Enter this test', - 'testwiki-title-open' => 'This is an open test wiki', - 'testwiki-text-open' => 'This is an open test wiki', + 'testwiki-enter' => 'Go to the Main Page', + 'testwiki-title-open' => 'This is an open wiki', + 'testwiki-text-open' => 'This is an open wiki', 'testwiki-requirements' => 'Requirements', 'wminc-unknownlang' => '(unknown language with code "$1")', - 'wminc-logo-wikipedia' => 'Wikipedia-logo-v2-en.svg', # only translate if necessary - 'wminc-logo-wiktionary' => 'Wiktionary-logo-en.svg', # only translate if necessary - 'wminc-logo-wikibooks' => 'Wikibooks-logo-en-noslogan.svg', # only translate if necessary - 'wminc-logo-wikinews' => 'Wikinews-logo-en.png', # only translate if necessary - 'wminc-logo-wikiquote' => 'Wikiquote-logo-en.svg', # only translate if necessary - 'wminc-logo-wikisource' => 'Wikisource-newberg-de.png', # only translate if necessary - 'wminc-logo-wikiversity' => 'Wikiversity-logo-en.svg', # only translate if necessary - 'wminc-logo-meta' => 'Wikiversity-logo-en.svg', # only translate if necessary - 'wminc-logo-commons' => 'Wikiversity-logo-en.svg', # only translate if necessary - 'wminc-logo-species' => 'Wikiversity-logo-en.svg', # only translate if necessary - 'wminc-logo-mediawiki' => 'Wikiversity-logo-en.svg', # only translate if necessary + 'wminc-logo-wikipedia' => 'Wikipedia-logo-v2-en.svg', + 'wminc-logo-wiktionary' => 'Wiktionary-logo-en.svg', + 'wminc-logo-wikibooks' => 'Wikibooks-logo-en-noslogan.svg', + 'wminc-logo-wikinews' => 'Wikinews-logo-en.png', + 'wminc-logo-wikiquote' => 'Wikiquote-logo-en.svg', + 'wminc-logo-wikisource' => 'Wikisource-newberg-de.png', + 'wminc-logo-wikiversity' => 'Wikiversity-logo-en.svg', + 'wminc-logo-meta-wiki' => 'Metawiki.svg', + 'wminc-logo-wikimedia-commons' => 'Commons-logo-en.svg', + 'wminc-logo-wikispecies' => 'WikiSpecies.svg', + 'wminc-logo-mediawiki' => 'MediaWiki.svg', 'wminc-manual-url' => 'Help:Manual', # only translate if necessary - 'wminc-infopage-tocreate-welcome' => 'Welcome to the Wikimedia Incubator, a project of the Wikimedia Foundation ([[{{MediaWiki:Aboutpage}}|About]])', - 'wminc-infopage-tocreate-text' => 'A $1 in this language does not yet exist.', - 'wminc-infopage-tocreate-options' => ' -* If you want to start this test wiki, you can [{{fullurl:{{FULLPAGENAME}}|action=edit}} create this info page] and follow [[{{MediaWiki:Wminc-manual-url}}|our manual]]. + 'wminc-infopage-title' => '$1 $2', # only translate if necessary + 'wminc-infopage-missingwiki-welcome' => 'Welcome to the Wikimedia Incubator, a project of the Wikimedia Foundation ([[{{MediaWiki:Aboutpage}}|About]])', + 'wminc-infopage-missingwiki-text' => 'A $1 in this language does not yet exist.', + 'wminc-infopage-missingwiki-options' => ' +* If you want to start this wiki, you can [{{fullurl:{{FULLPAGENAME}}|createmainpage=yes}} create the page] and follow [[{{MediaWiki:Wminc-manual-url}}|our manual]]. $3 * You can search for [http://www.$1.org existing language editions of $1]. -* You can search for existing projects in this language: $3 -* You can go to a multilingual wiki: -** [http://meta.wikimedia.org Meta-Wiki], the coordination wiki -** [http://commons.wikimedia.org Wikimedia Commons], a media file repository -** [http://species.wikimedia.org Wikispecies], a species directory -** [http://mediawiki.org MediaWiki], the software', - 'wminc-infopage-prefill' => '{{test wiki -| language = <!-- add your language\'s English name here--> -| mainpage = $1/<!-- add your language\'s equivalent of Main Page here--> -| meta = yes <!-- is there already a request on Meta? --> -}}', +* You can search for existing projects in this language: $4 +* You can go to a multilingual wiki: $5', + 'wminc-infopage-createmainpage' => 'Enter the word "Main Page" in this language:', + 'wminc-infopage-prefill' => '{{#nfopage:open}}', # need to improve this! 'wminc-infopage-contribute' => 'If you know this language, you are encouraged to contribute!', ); @@ -102,24 +96,10 @@ * @author SPQRobin */ $messages['nl'] = array( - 'testwiki-enter' => 'Ga naar deze test', + 'testwiki-enter' => 'Ga naar de hoofdpagina', 'wminc-unknownlang' => '(onbekende taal met code "$1")', 'wminc-infopage-tocreate-welcome' => 'Welkom op Wikimedia Incubator, een project van de Wikimedia Foundation ([[{{MediaWiki:Aboutpage}}|Meer info]])', 'wminc-infopage-tocreate-text' => 'Een $1 in deze taal bestaat nog niet.', - 'wminc-infopage-tocreate-options' => ' -* Als u deze testwiki wilt starten, kunt u [{{fullurl:{{FULLPAGENAME}}|action=edit}} deze infopagina aanmaken] en [[{{MediaWiki:Wminc-manual-url}}|onze handleiding]] volgen. -* U kunt naar [http://www.$1.org bestaande taaledities van $1] zoeken. -* U kunt naar bestaande projecten in deze taal zoeken: $3 -* U kunt naar een meertalige wiki gaan: -** [http://meta.wikimedia.org Meta-Wiki], de coördinatiewiki -** [http://commons.wikimedia.org Wikimedia Commons], een database van mediabestanden -** [http://species.wikimedia.org Wikispecies], een index van levende wezens -** [http://mediawiki.org MediaWiki], de software', - 'wminc-infopage-prefill' => '{{test wiki -| language = <!-- de naam in het Engels hier --> -| mainpage = $1/<!-- "Hoofdpagina" in deze taal hier --> -| meta = yes <!-- Is er al een aanvraag op Meta? --> -}}', 'wminc-infopage-contribute' => 'Als u deze taal kent, wordt u aangemoedigd om bij te dragen!', ); Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-06-21 15:23:07 UTC (rev 13) +++ trunk/InfoPage.php 2011-06-23 00:34:40 UTC (rev 14) @@ -1,188 +1,198 @@ <?php +/* +'missing' showMissingWiki() + A [Project] in this language does not yet exist. +'incubator' showIncubatingWiki() + 'open': This is a new Incubator wiki that is not yet verified by the language committee. + 'eligible': This Incubator wiki has been marked as eligible by the language committee. + 'imported': This Incubator wiki has been imported from xyz.wikiproject.org after that wiki was closed. + 'approved': This Incubator wiki has been approved by the language committee and will soon be created. +'subdomain' showExistingWiki() + 'created': This project has been approved by the language committee and is now available at xyz.wikiproject.org. + 'beforeincubator': This project was created before Wikimedia Incubator started and is available at xyz.wikiproject.org. +*/ +// This class is used for "Wx/xx(x)" pages class InfoPage { - public static function setup( &$parser ) { - $parser->setFunctionHook( 'infopage', 'InfoPage::render' ); - return true; + public function __construct( $title ) { + $prefixdata = IncubatorTest::analyzePrefix( $title, true ); + $ns = $title->getNamespace(); + if( isset( $prefixdata['error'] ) || $ns != NS_MAIN ) { + return; + } + global $wgOut, $wgRequest, $wmincScriptDir, $wmincProjects; + $this->mPrefix = $prefixdata['prefix']; + $this->mLangCode = $prefixdata['lang']; + $this->mProject = $prefixdata['project']; + $this->mProjectName = array_search( $this->mProject, $wmincProjects); + // Redirect to real main page if URL is Wx/xxx?goto=mainpage + if($wgRequest->getVal('goto') == 'mainpage' && $mainpage) { + // need to find a proper way + global $wgServer, $wgArticlePath; + header('Location: '.$wgServer.$wgArticlePath.$mainpage); + } + $wgOut->addExtensionStyle( $wmincScriptDir . 'InfoPage.css' ); + $this->mLangNames = $this->getLanguageNames(); + $this->mLangsData = $this->loadLanguagesData(); + $this->mThisLangData = (isset( $this->mLangsData[$this->mLangCode] ) ? $this->mLangsData[$this->mLangCode] : ''); + $this->mLangName = ( isset( $this->mLangNames[$this->mLangCode] ) ? + $this->mLangNames[$this->mLangCode] : wfMsg( 'wminc-unknownlang', $this->mLangCode ) ); } - public static function onGetMagic( &$magicWords, $langCode ) { - $magicWords['infopage'] = array( 0, 'infopage' ); - return true; + public function getLanguageNames( $code = '' ) { + // get data from CLDR extension if possible + if ( is_callable( array( 'LanguageNames', 'getNames' ) ) ) { + global $wgLang; + $langcode = ( $code ? $code : $wgLang->getCode() ); + return LanguageNames::getNames( $langcode, + LanguageNames::FALLBACK_NORMAL, + LanguageNames::LIST_MW_AND_CLDR + ); + } + // If we need to display something, use this as fallback + return Language::getLanguageNames( false ); } - public static function render( &$parser, $status='default', $meta=false, - $mainpage='', $created='', $bug='', $wparticle='', $since='' ) { - global $wgTitle, $wgOut, $wmincScriptDir; - // ### NEED TO FIX THIS: DO NOT HARDCODE EXTENSION PATH!! ### - // Only loads when editing pages??? - $wgOut->addExtensionStyle( $wmincScriptDir.'InfoPage.css' ); - if(!preg_match('/W[bnpqt]\/[a-z][a-z][a-z]?/', $wgTitle)) { - return '<div class="error">ERROR (#infopage): Page title is not in Wx/xx(x) format.</div>'; + public function loadLanguagesData() { + // return if MediaWiki:Incubator-code does not exists + $pagetitle = Title::makeTitle( NS_MEDIAWIKI, 'Incubator-codes' ); + if( !$pagetitle->exists() ) { + return; } - wfLoadExtensionMessages( 'InfoPage' ); - preg_match('/W([bnpqt])\/([a-z][a-z][a-z]?)/', $wgTitle, $matches); - /* Define variables */ - $project = $matches[1]; - $langcode = $matches[2]; - $mainpageurl = $wgTitle.'/' . ( $mainpage ? $mainpage : wfMsgExt( 'mainpage', array( 'language' => $langcode ) ) ); - $langdata = self::getLangData( $langcode ); - if( $langdata === false ) { - return 'This language is not yet in the database.'; + $article = new Article( $pagetitle ); + if( !$article->getTitle() ) { + return; } - - /* Start output */ - $out = ''; - if(!in_array($status,array('approved','tocreate')) && $langdata->valid != 'invalid') { - $out .= '<div rowspan="2" align="right">' . - '<div class="testwiki-entertest">[['.$mainpageurl.'|'.wfMsgNoTrans('testwiki-enter').']] > ></div>'. - '</div>'; - } - $out .= '<div class="testwiki-title" colspan="4">'.wfMsg('testwiki-title-'.$status).'</div>'; - if($status != 'approved' && $langdata->valid != 'invalid') { - $out .= '<div colspan="4" style="padding-left:3em;"><i>'.wfMsg('testwiki-contribute').'</i></div>'; - } - $out .= wfMsg('testwiki-text-'.$status, array($status, self::getNativeLangName($langcode), $created, $bug)) . - '<div valign="top">' . - self::renderInformation($status, $project, $langdata, $langcode, $since) . - self::renderLinks($status, $project, $langdata, $meta, $langcode) . - self::renderRequirements($status, $project, $langdata, $meta) . - '</div>' . - self::renderBottom(); - return '<div class="testwiki testwiki-'.$status.'" id="testwiki" cellpadding="5">'.$out.'</div>'; - } - - function renderInformation($status, $project, $lang, $langcode, $since) { - $t = '<span>'. - '<b>'.'Information'.'</b>'. - '<ul>'. - '<li>ISO 639-1: '; - if(preg_match('/[a-z][a-z][a-z]/',$langcode)) { $t .= 'none'; } else { $t .= $langcode; } - $t .= '</li>'. - '<li>[[I:ISO 639|ISO 639-3]]: '; - if($lang->valid == 'invalid') { $t .= 'none'; } else { $t .= '[[ISO639-3:'.$lang->code3.'|'.$lang->code3.']]'; } - $t .= '</li>'. - self::li('Language: '.'[[wikipedia:'.$lang->eng_name.' language|'.self::getNativeLangName($langcode).']]'); - $t .= self::li('Project: <span class="plainlinks">[http://www.'.self::getProject($project).'.org/ '.ucfirst(self::getProject($project)).']</span>'); - if($since) { - if($status == 'imported') { - $t .= self::li('Imported on: '.$since); - } else { - $t .= self::li('On Incubator since: '.$since); + $lines = preg_split( '#\n(?!s)#' , $article->getRawText() ); + // format like: + // code | type | otherinfo=blabla | moreinfo=blabla + foreach( $lines as $line ) { + $codedata = explode( '|', trim( $line ) ); + if( !isset( $codedata[0] ) || !isset( $codedata[1] ) ) { continue; } + $code = trim( $codedata[0] ); + unset( $codedata[0] ); + foreach( $codedata as $i => $codedatum ) { + $codedatum = explode( '=', trim( $codedatum ) ); + if( isset( $codedatum[1] ) ) { + $returndata[$code][trim($codedatum[0])] = trim( $codedatum[1] ); + } else { + $returndata[$code]['type'] = trim( $codedatum[0] ); + } } } - $t .= '<li>Directionality: '.( $lang->ltr ? 'LTR' : 'RTL' ).'</li>'; - $t .= '</ul></span>'; - return $t; + return $returndata; } - function renderLinks($status, $project, $lang, $meta, $langcode) { - global $wmincProjects; - $t = '<span>'. - '<b>Other links</b>'. - '<ul>'; - if($status != 'approved') { // If approved (and created hopefully), request and category are not needed - if($meta) { - $t .= self::li('[[meta:Requests for new languages/'.array_search($project, $wmincProjects).' '.$lang->eng_name.']]'); - } else { - $t .= self::li('No request at Meta'); - } - if($lang->valid != 'invalid') { - global $wgTitle; - $t .= self::li('[[:Category:'.$wgTitle.']]'); - } + // Small convenience function to display a (clickable) logo + public function makeLogo( $project, $clickable = true, $width = 25, $height = '', $url = '', $args = '' ) { + $projectForFile = preg_replace('/ /', '-', strtolower( $project ) ); + // TEMPORARILY TO REDUCE PAGE LOAD + $imageobj = '';/*wfFindFile( wfMsg( 'wminc-logo-' . $projectForFile ) );*/ + if ( $imageobj ) { + $thumb = $imageobj->transform( array( 'width' => $width ) ); + $logo = '<img src="' . $thumb->getUrl() . + '" title="'.$project.'" alt="'.$project. + '" width="'.$width.'" height="'.$height.'" '.$args.' />'; + } else { + $logo = $project; // image not found } - if($lang->valid != 'invalid') { // if the language code is valid, display relevant links about the language - $t .= self::li('[[ethnologue:'.$lang->code3.'|Ethnologue report]]'). - self::li('[[translatewiki:Portal:'.$langcode.'|Translatewiki.net portal]]'); + if( $clickable ) { + $useurl = ($url ? $url : 'http://www.'.strtolower( $project ).'.org/'); + return '<a href="'.$useurl.'" title="'.$project.'">'.$logo.'</a>'; + } else { + return $logo; } - $t .= '</ul></span>'; - return $t; } - function renderRequirements($status, $project, $lang, $meta) { - if(in_array($status, array('approved','tocreate'))) { return; } - $t = '<span>'. - '<b>'.wfMsg('testwiki-requirements').'</b>'. - '<ul>'; - if($project == 's') { - $t .= self::li('<span style="color:red;"><b>Requirement Error:</b></span> This project is a <b>Wikisource</b>! - Wikisources have to be made at the <b>[[oldwikisource:|Old Wikisource]]</b>!'); + public function listOtherProjects() { + global $wmincProjects, $wmincSisterProjects; + $otherProjects = $wmincProjects + $wmincSisterProjects; + foreach($otherProjects as $name => $code) { + $listOtherProjects[$code] = '<li>' . $this->makeLogo( $name, true, + 75, NULL, 'http://'.$this->mLangCode.'.'.$name.'.org/' ) . '</li>'; } - if($project == 'v') { - $t .= self::li('<span style="color:red;"><b>Requirement Error:</b></span> This project is a <b>Wikiversity</b>! - Wikiversities have to be made at the <b>[[betawikiversity:|Beta Wikiversity]]</b>!'); - } - if($lang->valid != 'invalid' && $meta) { - $t .= self::li('[[Meta:Language committee/Status/{{lcfirst:{{BASEPAGENAME}}}}/{{SUBPAGENAME}}|Requirements for an own WMF wiki]]'); - } - $t .= self::li(self::getValidationLevel($lang->valid)); - $t .= '</ul></span>'; - return $t; + unset($listOtherProjects[$this->mProject]); + return '<ul class="wminc-infopage-otherprojects">' . + implode( '', $listOtherProjects ) . '</ul>'; } - function renderBottom() { - global $wgUser; - $t = '<div valign="bottom" align="right">'. - '([[Incubator:Policy/Test language status|coordination]] | [[Template:Test wiki/translations|translate]])'. - '</div>'. - '<div style="font-size:95%;">'. - 'Your interface language is "'.self::getNativeLangName($wgUser->mOptions['language']).'" ('.$wgUser->mOptions['language'].'). '; - if($wgUser->mOptions['language'] == 'en') { - $t .= 'If you are an anonymous user, you can [[Special:Userlogin|log in / create an account]].'. - 'If you are a registered user, you can [[Special:Preferences|change your interface language]].'; - } else { - $t .= 'That is a language other than English, so you should see this template translated.'. - 'If not, you can [[Template:Test wiki/translations|help translating]] it.'; + public function listMultilingualProjects() { + global $wmincMultilingualProjects; + if( !is_array( $wmincMultilingualProjects ) ) { return; } + foreach($wmincMultilingualProjects as $url => $name) { + $list[$url] = '<li>' . $this->makeLogo( $name, true, + 75, NULL, 'http://'.$url.'/') . '</li>'; } - $t .= '</div>'; - return $t; + return '<ul class="wminc-infopage-multilingualprojects">' . + implode( '', $list ) . '</ul>'; +} + + // make "Wx/xxx/Main Page" + public function getMainPage( $withprefix = true ) { + // Get the provided value, otherwise take the "mainpage" msg + // in the language of this test wiki + $msg = ( isset( $this->mMainPage ) ? $this->mMainPage : + wfMsgExt( 'mainpage', array( 'language' => $this->mLangCode ) ) ); + if( !$withprefix ) { return $msg; } + return $this->mPrefix . '/' . $msg; } - function li($content) { - return '<li>'.$content."</li>\n"; + public function createMainPage() { + return Html::rawElement( 'span', array( 'class' => 'wminc-infopage-createmainpage' ), + Html::element( 'label', array( 'for' => 'createmainpage' ), + wfMsg( 'wminc-infopage-createmainpage' ) ) . ' ' . + Html::input( 'createmainpage', $this->getMainPage( false ) ) . ' ' . + Html::element( 'button', array( 'type' => 'submit' ), '→' ) + ); } - function getLangData( $langcode ) { - $dbr = wfGetDB( DB_SLAVE ); - if(preg_match('/[a-z][a-z]/',$langcode)) { - // The code in the page title is ISO 639-1 - $row = (object)$dbr->selectRow( 'inc_langs', '*', array( 'code1' => $langcode ) ); - if(!isset($row->code1)) { return false; } - } else { - // The code in the page title is ISO 639-3 - $row = (object)$dbr->selectRow( 'inc_langs', '*', array( 'code3' => $langcode ) ); - if(!isset($row->code3)) { return false; } - } - if(!$row) { return false; } - return (object)$row; + public function StandardInfoPage( $beforetitle, $aftertitle ) { + global $wgLang; + return Html::rawElement( 'div', array( 'class' => 'wminc-infopage plainlinks', + 'lang' => $wgLang->getCode(), 'dir' => wfUILang()->getDir() ), + $beforetitle . + Html::rawElement( 'div', array( 'class' => 'wminc-infopage-logo wminc-infopage-logo-' . + wfUILang()->AlignEnd() ), $this->makeLogo( $this->mProjectName, true, 175 ) + ) . + Html::rawElement( 'div', array( 'class' => 'wminc-infopage-title' ), + wfMsgWikiHtml( 'wminc-infopage-title', $this->mProjectName, $this->mLangName ) + ) . $aftertitle ); } - function getNativeLangName( $langcode ) { - global $wgLanguageNames; - if(isset($wgLanguageNames[$langcode])) { - return $wgLanguageNames[$langcode]; - } else { - $data = self::getLangData($langcode); - return $data->native_name; - } + public function showMissingWiki() { + global $wgRequest; + $welcome = Html::rawElement( 'div', array( 'class' => 'wminc-infopage-missingwiki-welcome' ), + wfMsgWikiHtml( 'wminc-infopage-missingwiki-welcome' ) ); + $content = Html::rawElement( 'div', array( 'class' => 'wminc-infopage-missingwiki-text' ), + wfMsgWikiHtml( 'wminc-infopage-missingwiki-text', $this->mProjectName, $this->mLangName ) ) . + Html::rawElement( 'ul', array( 'class' => 'wminc-infopage-missingwiki-options' ), + wfMsgWikiHtml( 'wminc-infopage-missingwiki-options', $this->mProjectName, + $this->mLangName, ( $wgRequest->getVal( 'createmainpage' ) ? + '<br />' . $this->CreateMainPage() : ''), + $this->listOtherProjects(), $this->listMultilingualProjects() ) + ); + return $this->StandardInfoPage( $welcome, $content ); } - function getValidationLevel($level) { - switch($level) { - case 'existing': return '<b>Requirement Error:</b> This language has existing wikis in <i>all</i> WMF projects.'; break; - case 'valid': return 'This test has a valid language code.'; break; - case 'invalid': return 'This test has an <span style="color:red;"><b>INVALID</b> language code</span> so does not fit the Incubator inclusion policy.'; break; - case 'history': return 'This test has a valid language code, but note that it is a historical or ancient language so it will be hard to get a Wikimedia project.'; break; - case 'macro': return 'The code "[[ethnologue:'.$langcode3.'|'.$langcode3.']]" is defined as a macrolanguage. This means it includes several individual languages. - Please define which code the appropriate one is, unless this language already has a Wikimedia wiki.'; break; - case 'collective': return 'The code "[[ethnologue:'.$langcode3.'|'.$langcode3.']]" is defined as a collection of languages. - This means it represents a group of individual languages. Please define which code the appropriate one is, - unless this language already has a Wikimedia wiki.'; break; - case 'notyetchecked': return 'The language code is not yet [{{fullurl:Template:Test wiki/validcode|action=edit}} checked].'; break; - case 'nearext': return 'This language has few native speakers, so it will be hard to get a Wikimedia project.'; break; - case 'special': return 'This language code is a special situation. There might be clarification below this template.'; break; - case 'art': return 'The language code is valid, but defined as an artificial language.'; break; - default: return 'Level not recognized'; break; + public function showIncubatingWiki() { + $status = $this->mStatus; + $bug = isset( $this->mBug ) ? $this->mBug : ''; + $created = isset( $this->mCreated ) ? $this->mCreated : ''; + $out = ''; + if( !in_array( $status, array( 'approved', 'tocreate' ) ) && $this->mThisLangData['type'] != 'invalid' ) { + $out .= '<div class="infopage-entertest infopage-entertest-' . wfUILang()->AlignEnd() . + '">→ [['. $this->getMainPage() . '|' . wfMsgNoTrans( 'infopage-enter' ) . ']]</div>'; } + $out .= '<div class="infopage-title">' . wfMsg( 'infopage-title-' . $status ) . '</div>'; + if( $status != 'approved' && $this->mThisLangData['type'] != 'invalid' ) { + $out .= '<div colspan="4" style="padding-left:3em;"><i>'.wfMsg( 'infopage-contribute' ).'</i></div>'; + } + $out .= wfMsg( 'infopage-text-' . $status, array( $status, 'Lol!', $created, $bug ) ); + $content = ''; + return '<div dir="' . wfUILang()->getDir() . '" class="infopage infopage-' . $status . + '" id="infopage" cellpadding="5">' . $out . '</div>' . $this->StandardInfoPage( '', $content ); } -} + + public function showExistingWiki() { + return ''; + } +} \ No newline at end of file Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-06-21 15:23:07 UTC (rev 13) +++ trunk/WikimediaIncubator.php 2011-06-23 00:34:40 UTC (rev 14) @@ -46,6 +46,12 @@ 'name' => 'Incubator', 'short' => 'inc', ); +$wmincMultilingualProjects = array( + 'meta.wikimedia.org' => 'Meta-Wiki', + 'commons.wikimedia.org' => 'Wikimedia Commons', + 'species.wikimedia.org' => 'Wikispecies', + 'mediawiki.org' => 'MediaWiki', +); $wmincTestWikiNamespaces = array( NS_MAIN, NS_TALK, NS_TEMPLATE, NS_TEMPLATE_TALK, @@ -112,11 +118,11 @@ /* Wx/xx[x] info page */ $wgAutoloadClasses['InfoPage'] = $dir . 'InfoPage.php'; # UNDER DEVELOPMENT -$wgHooks['ParserFirstCallInit'][] = 'InfoPage::setup'; # UNDER DEVELOPMENT -$wgHooks['LanguageGetMagic'][] = 'InfoPage::onGetMagic'; # UNDER DEVELOPMENT +$wgHooks['ParserFirstCallInit'][] = 'IncubatorTest::onParserFirstCallInit'; # UNDER DEVELOPMENT +$wgHooks['LanguageGetMagic'][] = 'IncubatorTest::onGetMagic'; # UNDER DEVELOPMENT $wgExtensionMessagesFiles['InfoPage'] = $dir . 'InfoPage.i18n.php'; # UNDER DEVELOPMENT -$wgHooks['ShowMissingArticle'][] = 'IncubatorTest::onShowMissingArticle'; # RELATIVELY STABLE FEATURE (should be transferred to InfoPage.php) -$wgHooks['EditFormPreloadText'][] = 'IncubatorTest::onEditFormPreloadText'; # RELATIVELY STABLE FEATURE (should be transferred to InfoPage.php) +$wgHooks['ShowMissingArticle'][] = 'IncubatorTest::onShowMissingArticle'; # RELATIVELY STABLE FEATURE +$wgHooks['EditFormPreloadText'][] = 'IncubatorTest::onEditFormPreloadText'; # RELATIVELY STABLE FEATURE /* Test wiki contributions */ $wgAutoloadClasses['SpecialTestWikiContributions'] = $dir . 'SpecialTestWikiContributions.php'; # TODO This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-06-21 15:23:13
|
Revision: 13 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=13&view=rev Author: robin-p Date: 2011-06-21 15:23:07 +0000 (Tue, 21 Jun 2011) Log Message: ----------- This is ridiculous code, but it works... Modified Paths: -------------- trunk/WikimediaIncubator.php Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-06-19 15:03:43 UTC (rev 12) +++ trunk/WikimediaIncubator.php 2011-06-21 15:23:07 UTC (rev 13) @@ -25,9 +25,10 @@ /* General (globals and/or configuration) */ $wmincPref = 'incubatortestwiki'; // Name of the preference $dir = dirname( __FILE__ ) . '/'; -// ### WE NEED TO FIND A GOOD WAY TO MAKE THIS AUTOMATIC ### -// ### it should return the web URL and not the location on the server (so dirname does not work) -$wmincScriptDir = $wgScriptPath.'/extensions/WikimediaIncubator-dev/trunk/'; +// Hack to get the extension path for the script path +$filename = $_SERVER['SCRIPT_FILENAME']; +$wmincScriptDir = $wgScriptPath . str_replace( '\\', '/', substr( dirname(__FILE__), + strlen( substr( $filename, 0, strrpos( $filename, '/' ) ) ) ) ) . '/'; // only one-letter codes can be used for projects $wmincProjects = array( 'Wikipedia' => 'p', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hy...@us...> - 2011-06-19 15:03:49
|
Revision: 12 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=12&view=rev Author: hydria Date: 2011-06-19 15:03:43 +0000 (Sun, 19 Jun 2011) Log Message: ----------- Renaming TestWikiExport to IncubatorExport as the term 'test wiki' is disputed and is awaiting new consensus to change it. Modified Paths: -------------- trunk/WikimediaIncubator.i18n.php trunk/WikimediaIncubator.php Added Paths: ----------- trunk/SpecialIncubatorExport.php Removed Paths: ------------- trunk/SpecialTestWikiExport.php Added: trunk/SpecialIncubatorExport.php =================================================================== --- trunk/SpecialIncubatorExport.php (rev 0) +++ trunk/SpecialIncubatorExport.php 2011-06-19 15:03:43 UTC (rev 12) @@ -0,0 +1,55 @@ +<?php +/** +* Special page to export all pages of a specific test wiki + * @file + */ + +class SpecialIncubatorExport extends SpecialPage +{ + public function __construct() { + parent::__construct( 'IncubatorExport' ); + } + + function getDescription() { return wfMsg( 'wminc-incubatorexport' ); } + + /** + * Show the special page + * @param $subpage Mixed: parameter passed to the page or null + */ + public function execute( $subpage ) { + global $wgRequest, $wgUser; + wfLoadExtensionMessages( 'WikimediaIncubator' ); + + $this->setHeaders(); + + if ( $subpage ) { + $target = $subpage; + } else { + $target = $wgRequest->getText( 'target' ); + } + + $this->showForm( $target ); + + if ( $target ) { + $this->showInfo( $target ); + } + } + + /** + * Currently does nothing, but Hydriz is assigned to this and a + * PrefixExport extension would be created from this. + * + * @todo + */ + function showForm( $target ) { + global $wgOut; + $wgOut->addHtml('to do'); + } + + /** + * + */ + function showInfo( $target ) { + + } +} Property changes on: trunk/SpecialIncubatorExport.php ___________________________________________________________________ Added: svn:eol-style + native Deleted: trunk/SpecialTestWikiExport.php =================================================================== --- trunk/SpecialTestWikiExport.php 2011-06-19 14:10:40 UTC (rev 11) +++ trunk/SpecialTestWikiExport.php 2011-06-19 15:03:43 UTC (rev 12) @@ -1,52 +0,0 @@ -<?php -/** -* Special page to export all pages of a specific test wiki - * @file - */ - -class SpecialTestWikiExport extends SpecialPage -{ - public function __construct() { - parent::__construct( 'TestWikiExport' ); - } - - function getDescription() { return wfMsg( 'wminc-testwikiexport' ); } - - /** - * Show the special page - * @param $subpage Mixed: parameter passed to the page or null - */ - public function execute( $subpage ) { - global $wgRequest, $wgUser; - wfLoadExtensionMessages( 'WikimediaIncubator' ); - - $this->setHeaders(); - - if ( $subpage ) { - $target = $subpage; - } else { - $target = $wgRequest->getText( 'target' ); - } - - $this->showForm( $target ); - - if ( $target ) { - $this->showInfo( $target ); - } - } - - /** - * - */ - function showForm( $target ) { - global $wgOut; - $wgOut->addHtml('to do'); - } - - /** - * - */ - function showInfo( $target ) { - - } -} Modified: trunk/WikimediaIncubator.i18n.php =================================================================== --- trunk/WikimediaIncubator.i18n.php 2011-06-19 14:10:40 UTC (rev 11) +++ trunk/WikimediaIncubator.i18n.php 2011-06-19 15:03:43 UTC (rev 12) @@ -31,7 +31,7 @@ 'randombytest' => 'Random page by test wiki', 'randombytest-nopages' => 'There are no pages in your test wiki, in the namespace: $1.', 'wminc-recentchanges-all' => 'All recent changes', - 'wminc-testwikiexport' => 'Export pages from a test wiki', + 'wminc-incubatorexport' => 'Export pages from a test wiki', 'wminc-requestwiki' => 'Request a new wiki', ); Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-06-19 14:10:40 UTC (rev 11) +++ trunk/WikimediaIncubator.php 2011-06-19 15:03:43 UTC (rev 12) @@ -106,8 +106,8 @@ $wgRemoveGroups['bureaucrat']['test-sysop'] = true; /* Test wiki export */ -$wgAutoloadClasses['SpecialTestWikiExport'] = $dir . 'SpecialTestWikiExport.php'; # TODO -$wgSpecialPages['TestWikiExport'] = 'SpecialTestWikiExport'; # TODO +$wgAutoloadClasses['SpecialIncubatorExport'] = $dir . 'SpecialIncubatorExport.php'; # TODO +$wgSpecialPages['IncubatorExport'] = 'SpecialIncubatorExport'; # TODO /* Wx/xx[x] info page */ $wgAutoloadClasses['InfoPage'] = $dir . 'InfoPage.php'; # UNDER DEVELOPMENT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hy...@us...> - 2011-06-19 14:10:46
|
Revision: 11 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=11&view=rev Author: hydria Date: 2011-06-19 14:10:40 +0000 (Sun, 19 Jun 2011) Log Message: ----------- Some minor stuff Modified Paths: -------------- trunk/IncubatorTest.php trunk/InfoPage.i18n.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-06-15 15:07:09 UTC (rev 10) +++ trunk/IncubatorTest.php 2011-06-19 14:10:40 UTC (rev 11) @@ -340,7 +340,7 @@ return true; } global $wgOut, $wmincProjects, $wgNames, $wmincSisterProjects, $wmincScriptDir; - $wgOut->addExtensionStyle( $wmincScriptDir.'InfoPage.css' ); + $wgOut->addExtensionStyle( $wmincScriptDir.'InfoPage.css' ); // URGENT FIXME, unable to load CSS file unless forced in MediaWiki:Common.css $languages = self::getLanguageNames(); $projectcode = $prefixdata['project']; $langcode = $prefixdata['lang']; @@ -426,4 +426,4 @@ $wgLogo = $thumb->getUrl(); return true; } -} \ No newline at end of file +} Modified: trunk/InfoPage.i18n.php =================================================================== --- trunk/InfoPage.i18n.php 2011-06-15 15:07:09 UTC (rev 10) +++ trunk/InfoPage.i18n.php 2011-06-19 14:10:40 UTC (rev 11) @@ -28,7 +28,7 @@ 'wminc-logo-species' => 'Wikiversity-logo-en.svg', # only translate if necessary 'wminc-logo-mediawiki' => 'Wikiversity-logo-en.svg', # only translate if necessary 'wminc-manual-url' => 'Help:Manual', # only translate if necessary - 'wminc-infopage-tocreate-welcome' => 'Welcome to Wikimedia Incubator, a project of the Wikimedia Foundation ([[{{MediaWiki:Aboutpage}}|About]])', + 'wminc-infopage-tocreate-welcome' => 'Welcome to the Wikimedia Incubator, a project of the Wikimedia Foundation ([[{{MediaWiki:Aboutpage}}|About]])', 'wminc-infopage-tocreate-text' => 'A $1 in this language does not yet exist.', 'wminc-infopage-tocreate-options' => ' * If you want to start this test wiki, you can [{{fullurl:{{FULLPAGENAME}}|action=edit}} create this info page] and follow [[{{MediaWiki:Wminc-manual-url}}|our manual]]. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hy...@us...> - 2011-06-15 15:07:15
|
Revision: 10 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=10&view=rev Author: hydria Date: 2011-06-15 15:07:09 +0000 (Wed, 15 Jun 2011) Log Message: ----------- We are in trunk code, it is okay to test Modified Paths: -------------- trunk/SpecialTestWikiContributions.php trunk/WikimediaIncubator.php Modified: trunk/SpecialTestWikiContributions.php =================================================================== --- trunk/SpecialTestWikiContributions.php 2011-06-11 23:15:06 UTC (rev 9) +++ trunk/SpecialTestWikiContributions.php 2011-06-15 15:07:09 UTC (rev 10) @@ -55,7 +55,8 @@ if( in_array( $name, array( 'namespace', 'target', 'contribs', 'year', 'month', 'testwiki' ) ) ) { continue; } - $f .= "\t" . Xml::hidden( $name, $value ) . "\n"; + # Deprecated, FIXME +# $f .= "\t" . Xml::hidden( $name, $value ) . "\n"; } $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] ); Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-06-11 23:15:06 UTC (rev 9) +++ trunk/WikimediaIncubator.php 2011-06-15 15:07:09 UTC (rev 10) @@ -118,8 +118,8 @@ $wgHooks['EditFormPreloadText'][] = 'IncubatorTest::onEditFormPreloadText'; # RELATIVELY STABLE FEATURE (should be transferred to InfoPage.php) /* Test wiki contributions */ -#$wgAutoloadClasses['SpecialTestWikiContributions'] = $dir . 'SpecialTestWikiContributions.php'; # TODO -#$wgSpecialPages['TestWikiContributions'] = 'SpecialTestWikiContributions'; # TODO +$wgAutoloadClasses['SpecialTestWikiContributions'] = $dir . 'SpecialTestWikiContributions.php'; # TODO +$wgSpecialPages['TestWikiContributions'] = 'SpecialTestWikiContributions'; # TODO /* RequestWiki */ $wgAutoloadClasses['SpecialRequestWiki'] = $dir . 'SpecialRequestWiki.php'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-06-11 23:15:13
|
Revision: 9 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=9&view=rev Author: robin-p Date: 2011-06-11 23:15:06 +0000 (Sat, 11 Jun 2011) Log Message: ----------- sync to version 3.1.1 in svn Modified Paths: -------------- trunk/IncubatorTest.php trunk/SpecialRandomByTest.php trunk/SpecialViewUserLang.php trunk/TestWikiRC.php trunk/WikimediaIncubator.i18n.php trunk/WikimediaIncubator.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-06-01 21:11:25 UTC (rev 8) +++ trunk/IncubatorTest.php 2011-06-11 23:15:06 UTC (rev 9) @@ -104,7 +104,7 @@ */ static function validatePrefix( $title, $onlyprefix = false ) { $data = self::analyzePrefix( $title, $onlyprefix ); - if( isset( $data['error'] ) ) { return true; } + if( !isset( $data['error'] ) ) { return true; } return false; } @@ -125,13 +125,16 @@ */ static function displayPrefix( $project = '', $code = '' ) { global $wgUser, $wmincPref; - if ( self::isContentProject() ) { - // return the prefix - return 'W' . ( $project ? $project : $wgUser->getOption($wmincPref . '-project') ) . - '/' . ( $code ? $code : $wgUser->getOption($wmincPref . '-code') ); // return the prefix + $projectvalue = ( $project ? $project : $wgUser->getOption($wmincPref . '-project') ); + $codevalue = ( $code ? $code : $wgUser->getOption($wmincPref . '-code') ); + if ( self::isContentProject( $projectvalue ) ) { + // if parameters are set OR it falls back to user pref and + // he has a content project pref set -> return the prefix + return 'W' . $projectvalue . '/' . $codevalue; // return the prefix } else { - // still provide the value - return $wgUser->getOption($wmincPref . '-project'); + // fall back to user pref with NO content pref set + // -> still provide the value (probably 'none' or 'inc') + return $projectvalue; } } @@ -249,7 +252,7 @@ static function efLoadViewUserLangLink( $id, $nt, &$links ) { global $wgUser; if ( $wgUser->isAllowed( 'viewuserlang' ) ) { - $user = wfUrlencode( $nt->getText() ); + $user = $nt->getText(); $links[] = $wgUser->getSkin()->link( SpecialPage::getTitleFor( 'ViewUserLang', $user ), wfMsgHtml( 'wminc-viewuserlang' ) Modified: trunk/SpecialRandomByTest.php =================================================================== --- trunk/SpecialRandomByTest.php 2011-06-01 21:11:25 UTC (rev 8) +++ trunk/SpecialRandomByTest.php 2011-06-11 23:15:06 UTC (rev 9) @@ -7,14 +7,22 @@ class SpecialRandomByTest extends RandomPage { public function __construct() { - global $wgUser, $wmincPref, $wmincProjectSite; - if( IncubatorTest::isContentProject() ) { + global $wgUser, $wgRequest, $wmincPref, $wmincProjectSite; + $target = $wgRequest->getVal( 'testwiki' ); + $target = IncubatorTest::analyzePrefix( $target ); + $project = ( isset( $target['project'] ) ? $target['project'] : '' ); + $lang = ( isset( $target['lang'] ) ? $target['lang'] : '' ); + if( IncubatorTest::isContentProject() || ($project && $lang) ) { $dbr = wfGetDB( DB_SLAVE ); $this->extra[] = 'page_title' . - $dbr->buildLike( IncubatorTest::displayPrefix() . '/', $dbr->anyString() ); + $dbr->buildLike( IncubatorTest::displayPrefix( $project, $lang ) . '/', $dbr->anyString() ); } elseif($wgUser->getOption($wmincPref . '-project') == $wmincProjectSite['short'] ) { - // project or help namespace - $this->extra['page_namespace'] = array( 4, 12 ); + global $wgVersion; + // only works above MW 1.17 + if( version_compare($wgVersion, '1.17', '>') ) { + // project or help namespace + $this->extra['page_namespace'] = array( 4, 12 ); + } } parent::__construct( 'RandomByTest' ); } Modified: trunk/SpecialViewUserLang.php =================================================================== --- trunk/SpecialViewUserLang.php 2011-06-01 21:11:25 UTC (rev 8) +++ trunk/SpecialViewUserLang.php 2011-06-11 23:15:06 UTC (rev 9) @@ -67,30 +67,31 @@ * @param $target Mixed: user whose language and test wiki we're looking up */ function showInfo( $target ) { - global $wgOut, $wmincPref, $wmincProjectSite; - $sk = $this->getSkin(); + global $wgOut, $wmincPref, $wmincProjectSite, $wgUser; + $sk = $wgUser->getSkin(); $user = User::newFromName( $target ); + $name = $user->getName(); + $id = $user->getId(); $langNames = Language::getLanguageNames(); - if ( $user == null || $user->getId() == 0 ) { + if ( $user == null || $id == 0 ) { // show error if a user with that name does not exist $wgOut->addHTML( Xml::span( wfMsg( 'wminc-userdoesnotexist', $target ), 'error' ) ); } else { - $prefix = IncubatorTest::displayPrefix( - $user->getOption( $wmincPref . '-project' ), - $user->getOption( $wmincPref . '-code' ) - ); - if ( IncubatorTest::isContentProject() ) { + $userproject = $user->getOption( $wmincPref . '-project' ); + $userproject = ($userproject ? $userproject : 'none'); + $usercode = $user->getOption( $wmincPref . '-code' ); + $prefix = IncubatorTest::displayPrefix( $userproject, $usercode ); + if ( IncubatorTest::isContentProject( $userproject ) ) { $testwiki = $sk->link( Title::newFromText( $prefix ) ); } elseif ( $prefix == $wmincProjectSite['short'] ) { $testwiki = htmlspecialchars( $wmincProjectSite['name'] ); } else { $testwiki = wfMsgHtml( 'wminc-testwiki-none' ); } - $name = $user->getName(); $wgOut->addHtml( Xml::openElement( 'ul' ) . '<li>' . wfMsgHtml( 'username' ) . ' ' . - $sk->userLink( $name, $name ) . $sk->userToolLinks( $name, $name ) . '</li>' . + $sk->userLink( $id, $name ) . $sk->userToolLinks( $id, $name, true ) . '</li>' . '<li>' . wfMsgHtml( 'loginlanguagelabel', $langNames[$user->getOption( 'language' )] . ' (' . $user->getOption( 'language' ) . ')' ) . '</li>' . '<li>' . wfMsgHtml( 'wminc-testwiki' ) . ' ' . $testwiki . '</li>' . Modified: trunk/TestWikiRC.php =================================================================== --- trunk/TestWikiRC.php 2011-06-01 21:11:25 UTC (rev 8) +++ trunk/TestWikiRC.php 2011-06-11 23:15:06 UTC (rev 9) @@ -20,12 +20,14 @@ // If project site is selected, display all changes except test wiki changes $dbr = wfGetDB( DB_SLAVE ); $conds[] = 'rc_title NOT ' . $dbr->buildLike( 'W', $dbr->anyChar(), '/', $dbr->anyString() ); - } else { + } elseif( IncubatorTest::validatePrefix( $prefix, true ) ) { // Else, display changes to the selected test wiki in the appropriate namespaces $dbr = wfGetDB( DB_SLAVE ); $conds['rc_namespace'] = $wmincTestWikiNamespaces; $conds[] = 'rc_title ' . $dbr->buildLike( $prefix . '/', $dbr->anyString() ) . ' OR rc_title = ' . $dbr->addQuotes( $prefix ); + } else { + return true; } return true; } Modified: trunk/WikimediaIncubator.i18n.php =================================================================== --- trunk/WikimediaIncubator.i18n.php 2011-06-01 21:11:25 UTC (rev 8) +++ trunk/WikimediaIncubator.i18n.php 2011-06-11 23:15:06 UTC (rev 9) @@ -419,19 +419,19 @@ 'wminc-viewuserlang-go' => 'Holen', 'wminc-userdoesnotexist' => 'Der Benutzer „$1“ ist nicht vorhanden.', 'wminc-testwiki' => 'Testwiki:', - 'wminc-testwiki-none' => 'Keine/ Alle', + 'wminc-testwiki-none' => 'Keins/Alle', 'wminc-prefinfo-language' => 'Sprache deiner Benutzeroberfläche - vom Testwiki unabhängig', 'wminc-prefinfo-code' => 'Der ISO-639-Sprachcode', 'wminc-prefinfo-project' => 'Das Wikimedia-Projekt, an dem du hier arbeitest („Incubator“ für Benutzer, die allgemeine Aufgaben übernehmen)', 'wminc-prefinfo-error' => 'Bei diesem Projekt muss ein Sprachcode angeben werden!', - 'wminc-error-move-unprefixed' => 'Fehler: Die Seite die du zu verschieben versuchst hat entweder [[{{MediaWiki:Helppage}}|keinen oder einen falschen Präfix]].', - 'wminc-error-wronglangcode' => "'''Fehler:''' Die Seite die du zu bearbeiten versuchst hat einen [[{{MediaWiki:Helppage}}|falschen Sprachcode]]: \"\$1\".", - 'wminc-error-unprefixed' => "'''Fehler:''' Die Seite die du zu bearbeiten versuchst hat [[{{MediaWiki:Helppage}}|keinen Präfix]].", - 'wminc-error-unprefixed-suggest' => "'''Fehler:''' Die Seite die du zu bearbeiten versuchst hat [[{{MediaWiki:Helppage}}|keinen Präfix]]. Du kannst unter [[:$1]] eine Seite erstellen.", + 'wminc-error-move-unprefixed' => 'Fehler: Die Seite, die du verschieben willst, hat [[{{MediaWiki:Helppage}}|kein oder ein falsches Präfix]].', + 'wminc-error-wronglangcode' => "'''Fehler:''' Die Seite, die du zu bearbeiten versuchst, hat einen [[{{MediaWiki:Helppage}}|falschen Sprachcode]]: \"\$1\".", + 'wminc-error-unprefixed' => "'''Fehler:''' Die Seite, die du zu bearbeiten versuchst, hat [[{{MediaWiki:Helppage}}|kein Präfix]].", + 'wminc-error-unprefixed-suggest' => "'''Fehler:''' Die Seite, die du zu bearbeiten versuchst, hat [[{{MediaWiki:Helppage}}|kein Präfix]]. Du kannst unter [[:$1]] eine Seite anlegen.", 'right-viewuserlang' => '[[Special:ViewUserLang|Benutzersprache und Testwiki]] anschauen', 'randombytest' => 'Zufällige Seite aus dem Testwiki', 'randombytest-nopages' => 'Es befinden sich keine Seiten im Namensraum „$1“ deines Testwikis.', - 'wminc-recentchanges-all' => 'Alle letzte Änderungen', + 'wminc-recentchanges-all' => 'Alle letzten Änderungen', ); /** German (formal address) (Deutsch (Sie-Form)) @@ -442,10 +442,10 @@ $messages['de-formal'] = array( 'wminc-prefinfo-language' => 'Sprache Ihrer Benutzeroberfläche - vom Testwiki unabhängig', 'wminc-prefinfo-project' => 'Das Wikimedia-Projekt, an dem Sie hier arbeiten („Incubator“ für Benutzer, die allgemeine Aufgaben übernehmen)', - 'wminc-error-move-unprefixed' => 'Fehler: Die Seite die Sie zu verschieben versuchen hat entweder [[{{MediaWiki:Helppage}}|keinen oder einen falschen Präfix]].', - 'wminc-error-wronglangcode' => "'''Fehler:''' Die Seite die Sie zu bearbeiten versuchen hat einen [[{{MediaWiki:Helppage}}|falschen Sprachcode]]: \"\$1\".", - 'wminc-error-unprefixed' => "'''Fehler:''' Die Seite die Sie zu bearbeiten versuchen hat [[{{MediaWiki:Helppage}}|keinen Präfix]].", - 'wminc-error-unprefixed-suggest' => "'''Fehler:''' Die Seite die Sie zu bearbeiten versuchen hat [[{{MediaWiki:Helppage}}|keinen Präfix]]. Sie können unter [[:$1]] eine Seite erstellen.", + 'wminc-error-move-unprefixed' => 'Fehler: Die Seite, die Sie verschieben wollen, hat entweder [[{{MediaWiki:Helppage}}|kein oder ein falsches Präfix]].', + 'wminc-error-wronglangcode' => "'''Fehler:''' Die Seite, die Sie zu bearbeiten versuchen, hat einen [[{{MediaWiki:Helppage}}|falschen Sprachcode]]: \"\$1\".", + 'wminc-error-unprefixed' => "'''Fehler:''' Die Seite, die Sie zu bearbeiten versuchen, hat [[{{MediaWiki:Helppage}}|kein Präfix]].", + 'wminc-error-unprefixed-suggest' => "'''Fehler:''' Die Seite, die Sie zu bearbeiten versuchen, hat [[{{MediaWiki:Helppage}}|kein Präfix]]. Sie können unter [[:$1]] eine Seite anlegen.", 'randombytest-nopages' => 'Es befinden sich keine Seiten im Namensraum „$1“ Ihres Testwikis.', ); @@ -598,12 +598,10 @@ 'wminc-prefinfo-code' => 'ISO 639 hizkuntza kodea', 'wminc-prefinfo-project' => 'Aukeratu Wikimedia proiektua (Incubator aukera lan orokorra egiten dutenentzako da)', 'wminc-prefinfo-error' => 'Hizkuntza-kodea behar duen proiektua aukeratu duzu.', - 'wminc-warning-unprefixed' => "'''Abisua:''' Editatzen ari zaren orrialdeak ez du aurrizkirik!", - 'wminc-warning-suggest' => '[[:$1]]-(e)an orrialdea sortu dezakezu.', - 'wminc-warning-suggest-move' => 'Orrialde hau [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} $1-(e)ra mugitu dezakezu].', 'right-viewuserlang' => 'Ikusi [[Special:ViewUserLang|lankide hizkuntza eta wiki testa]]', 'randombytest' => 'Wiiki testaren ausazko orria', 'randombytest-nopages' => 'Ez dago orrialderik zure proba wikian, $1 izen-tartearekin.', + 'wminc-recentchanges-all' => 'Aldaketa berri guztiak', ); /** Persian (فارسی) @@ -651,6 +649,7 @@ * @author Crochet.david * @author IAlex * @author PieRRoMaN + * @author Sylvain2803 * @author Urhixidur */ $messages['fr'] = array( @@ -665,12 +664,14 @@ 'wminc-prefinfo-code' => 'Le code ISO 639 de la langue', 'wminc-prefinfo-project' => 'Sélectionnez le projet Wikimedia (l’option Incubator est destinée aux utilisateurs qui font un travail général)', 'wminc-prefinfo-error' => 'Vous avez sélectionné un projet qui nécessite un code de langue.', - 'wminc-warning-unprefixed' => "'''Attention :''' la page que vous modifiez n’a pas de préfixe !", - 'wminc-warning-suggest' => 'Vous pouvez créer la page à [[:$1]].', - 'wminc-warning-suggest-move' => 'Vous pouvez [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} renommer cette page vers $1].', + 'wminc-error-move-unprefixed' => "Erreur : La page vers laquelle vous tentez de renommer [[{{MediaWiki:Helppage}}|n'a pas de préfixe ou a un préfixe erroné]] !", + 'wminc-error-wronglangcode' => "'''Erreur:''' la page que vous essayez d'éditer contient un [[{{MediaWiki:Helppage}}|code de langue erroné]] \"\$1\" !", + 'wminc-error-unprefixed' => "''' Erreur:''' la page que vous essayez d'éditer n'a [[{{MediaWiki:Helppage}}|pas de préfixe]] !", + 'wminc-error-unprefixed-suggest' => "''' Erreur:''' la page que vous essayez d'éditer n'a [[{{MediaWiki:Helppage}}|pas de préfixe]] ! Vous pouvez créer la page suivante : [[:$1]].", 'right-viewuserlang' => 'Voir [[Special:ViewUserLang|la langue de l’utilisateur et le wiki de test]]', 'randombytest' => 'Page aléatoire par le wiki de test', 'randombytest-nopages' => 'Votre wiki de test ne contient pas de page dans l’espace de noms : $1.', + 'wminc-recentchanges-all' => 'Toutes les modifications récentes', ); /** Franco-Provençal (Arpetan) @@ -682,15 +683,13 @@ 'wminc-viewuserlang' => 'Vêre la lengoua a l’utilisator et lo vouiqui d’èprôva', 'wminc-viewuserlang-user' => 'Nom d’utilisator :', 'wminc-viewuserlang-go' => 'Alar trovar', + 'wminc-userdoesnotexist' => 'L’utilisator « $1 » ègziste pas.', 'wminc-testwiki' => 'Vouiqui d’èprôva :', 'wminc-testwiki-none' => 'Nion / tôs', 'wminc-prefinfo-language' => 'Voutra lengoua d’entèrface - endèpendenta de cela de voutron vouiqui d’èprôva', 'wminc-prefinfo-code' => 'Lo code ISO 639 de la lengoua', 'wminc-prefinfo-project' => 'Chouèsésséd lo projèt Wikimedia (lo chouèx Covosa est dèstinâ ux utilisators que font un travâly g·ènèral)', 'wminc-prefinfo-error' => 'Vos éd chouèsi un projèt qu’at fôta d’un code lengoua.', - 'wminc-warning-unprefixed' => "'''Atencion :''' la pâge que vos changiéd at gins de prèfixo !", - 'wminc-warning-suggest' => 'Vos pouede fâre la pâge a [[:$1]].', - 'wminc-warning-suggest-move' => 'Vos pouede [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} renomar ceta pâge vers $1].', 'right-viewuserlang' => 'Vêre la [[Special:ViewUserLang|lengoua a l’utilisator et lo vouiqui d’èprôva]]', 'randombytest' => 'Pâge a l’hasârd per lo vouiqui d’èprôva', 'randombytest-nopages' => 'Voutron vouiqui d’èprôva contint gins de pâge dens l’èspâço de noms : $1.', @@ -711,6 +710,10 @@ 'wminc-prefinfo-code' => 'O código de lingua ISO 639', 'wminc-prefinfo-project' => 'Seleccione o proxecto Wikimedia (a opción da Incubadora é para os usuarios que fan traballo xeral)', 'wminc-prefinfo-error' => 'Escolleu un proxecto que precisa dun código de lingua.', + 'wminc-error-move-unprefixed' => 'Erro: A páxina de destino [[{{MediaWiki:Helppage}}|non ten prefixo ou este é incorrecto]]!', + 'wminc-error-wronglangcode' => "'''Erro:''' A páxina que intenta editar contén un [[{{MediaWiki:Helppage}}|código de lingua incorrecto]] (\"\$1\")!", + 'wminc-error-unprefixed' => "'''Erro:''' A páxina que intenta editar non ten [[{{MediaWiki:Helppage}}|prefixo]]!", + 'wminc-error-unprefixed-suggest' => "'''Erro:''' A páxina que intenta editar non ten [[{{MediaWiki:Helppage}}|prefixo]]! Pode crear unha páxina en \"[[:\$1]]\".", 'right-viewuserlang' => 'Ver [[Special:ViewUserLang|a lingua do usuario e o wiki de probas]]', 'randombytest' => 'Páxina ao chou para o wiki de proba', 'randombytest-nopages' => 'O seu wiki de proba aínda non ten páxinas no espazo de nomes: $1.', @@ -1154,6 +1157,7 @@ ); /** Lithuanian (Lietuvių) + * @author Eitvys200 * @author Hugo.arg */ $messages['lt'] = array( @@ -1161,14 +1165,12 @@ 'wminc-viewuserlang' => 'Ieškoti vartotojo kalbos ir testavimo wiki', 'wminc-viewuserlang-user' => 'Naudotojo vardas:', 'wminc-viewuserlang-go' => 'Eiti', + 'wminc-userdoesnotexist' => 'Vartotojas " $1 "neegzistuoja.', 'wminc-testwiki' => 'Testavimo wiki:', 'wminc-testwiki-none' => 'Nei vienas/Visi', 'wminc-prefinfo-language' => 'Jūsų sąsajos kalba - nepriklausomai nuo jūsų testavimo wiki', 'wminc-prefinfo-code' => 'ISO 639 kalbos kodas', 'wminc-prefinfo-error' => 'Jūs pasirinkote projektą, kuriam reikia kalbos kodo.', - 'wminc-warning-unprefixed' => "'''Dėmėsio:''' Puslapis, kurį bandote redaguoti, neturi priešdėlio!", - 'wminc-warning-suggest' => 'Galite sukurti puslapį čia: [[:$1]].', - 'wminc-warning-suggest-move' => 'Galite [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} perkelti puslapį į $1].', 'right-viewuserlang' => 'Žiūrėti [[Special:ViewUserLang|naudotojo kalbą ir testavimo wiki]]', 'randombytest' => 'Atsitiktinis puslapis iš testavimo wiki', ); @@ -1343,10 +1345,10 @@ 'wminc-prefinfo-code' => 'De ISO 639-taalcode', 'wminc-prefinfo-project' => 'Selecteer het Wikimedia-project (Incubator-optie is voor gebruikers die algemeen werk doen)', 'wminc-prefinfo-error' => 'U selecteerde een project dat een taalcode nodig heeft.', - 'wminc-error-move-unprefixed' => 'Fout: De pagina waarnaar u probeert te hernoemen [[{{MediaWiki:Helppage}}|heeft geen prefix of een verkeerde prefix]]!', - 'wminc-error-wronglangcode' => "'''Fout:''' De pagina die u probeert te bewerken bevat een [[{{MediaWiki:Helppage}}|verkeerde taalcode]] \"\$1\"!", - 'wminc-error-unprefixed' => "'''Fout:''' De pagina die u probeert te bewerken heeft [[{{MediaWiki:Helppage}}|geen prefix]]!", - 'wminc-error-unprefixed-suggest' => "'''Fout:''' De pagina die u probeert te bewerken heeft [[{{MediaWiki:Helppage}}|geen prefix]]! U kunt een pagina aanmaken op [[:$1]].", + 'wminc-error-move-unprefixed' => 'Fout: De doelpagina waarnaar u probeert te hernoemen [[{{MediaWiki:Helppage}}|heeft geen of een verkeerd voorvoegsel]]!', + 'wminc-error-wronglangcode' => "'''Fout:''' De pagina die u probeert te bewerken bevat een [[{{MediaWiki:Helppage}}|verkeerde taalcode]] \"\$1\".", + 'wminc-error-unprefixed' => "'''Fout:''' De pagina die u probeert te bewerken heeft [[{{MediaWiki:Helppage}}|geen voorvoegsel]]!", + 'wminc-error-unprefixed-suggest' => "'''Fout:''' De pagina die u probeert te bewerken heeft [[{{MediaWiki:Helppage}}|geen voorvoegsel]]. U kunt een pagina aanmaken op [[:$1]].", 'right-viewuserlang' => '[[Special:ViewUserLang|Gebruikerstaal en test wiki]] bekijken', 'randombytest' => 'Willekeurige pagina uit testwiki', 'randombytest-nopages' => "Er zijn geen pagina's in uw testwiki in de naamruimte $1.", @@ -1745,12 +1747,14 @@ 'wminc-prefinfo-code' => 'Koda jezika ISO 639', 'wminc-prefinfo-project' => 'Izberite projekt Wikimedie (možnost Incubator je namenjena uporabnikom, ki opravljajo splošna dela)', 'wminc-prefinfo-error' => 'Izbrali ste projekt, ki zahteva kodo jezika.', - 'wminc-warning-unprefixed' => "'''Opozorilo:''' Stran, ki jo urejate, nima predpone!", - 'wminc-warning-suggest' => 'Ustvarite lahko stran na [[:$1]].', - 'wminc-warning-suggest-move' => 'To stran lahko [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} prestavite na $1].', + 'wminc-error-move-unprefixed' => 'Napaka: Stran, na katero skušate prestaviti, [[{{MediaWiki:Helppage}}|nima predpone ali ima napačno predpono]]!', + 'wminc-error-wronglangcode' => "'''Napak:''' Stran, ki jo poskušate urediti, vsebuje [[{{MediaWiki:Helppage}}|napačno kodo jezika]] »$1«!", + 'wminc-error-unprefixed' => "'''Napak:''' Stran, ki jo poskušate urediti, [[{{MediaWiki:Helppage}}|nima predpone]]!", + 'wminc-error-unprefixed-suggest' => "'''Napak:''' Stran, ki jo poskušate urediti, [[{{MediaWiki:Helppage}}|nima predpone]]! Stran lahko ustvarite na [[:$1]].", 'right-viewuserlang' => 'Vpogled v [[Special:ViewUserLang|jezik in preizkusni wiki uporabnika]]', 'randombytest' => 'Naključna stran preizkusnega wikija', 'randombytest-nopages' => 'Na vašem wikiju ni strani v imenskem prostoru: $1.', + 'wminc-recentchanges-all' => 'Vse zadnje spremembe', ); /** Serbian Cyrillic ekavian (Српски (ћирилица)) @@ -2001,12 +2005,14 @@ 'wminc-prefinfo-code' => 'Mã ngôn ngữ ISO 639', 'wminc-prefinfo-project' => 'Hãy chọn dự án Wikimedia (hay Incubator để làm việc chung)', 'wminc-prefinfo-error' => 'Bạn đã chọn một dự án bắt phải có mã ngôn ngữ.', - 'wminc-warning-unprefixed' => 'Cảnh báo: bạn đang sửa đổi trang chưa có tiền tố!', - 'wminc-warning-suggest' => 'Bạn có thể tạo trang “[[:$1]]”.', - 'wminc-warning-suggest-move' => 'Bạn có thể [{{fullurl:Special:MovePage/$3|wpNewTitle=$2}} di chuyển trang này đến $1].', + 'wminc-error-move-unprefixed' => 'Lỗi: Tên mới của trang [[{{MediaWiki:Helppage}}|thiếu tiền tố hoặc có tiền tố sai]]!', + 'wminc-error-wronglangcode' => "'''Lỗi:''' Trang đang được sửa đổi có [[{{MediaWiki:Helppage}}|mã ngôn ngữ sai]]: “$1”!", + 'wminc-error-unprefixed' => "'''Lỗi:''' Trang đang được sửa đổi [[{{MediaWiki:Helppage}}|thiếu tiền tố]]!", + 'wminc-error-unprefixed-suggest' => "'''Lỗi:''' Trang đang được sửa đổi [[{{MediaWiki:Helppage}}|thiếu tiền tố]]! Bạn có thể tạo trang tại “[[:$1]]” thay thế.", 'right-viewuserlang' => 'Xem [[Special:ViewUserLang|ngôn ngữ và wiki thử của người dùng]]', 'randombytest' => 'Trang ngẫu nhiên theo wiki thử', 'randombytest-nopages' => 'Không có trang này tại wiki thử của bạn trong không gian tên “$1”.', + 'wminc-recentchanges-all' => 'Mọi thay đổi gần đây', ); /** Yiddish (ייִדיש) Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-06-01 21:11:25 UTC (rev 8) +++ trunk/WikimediaIncubator.php 2011-06-11 23:15:06 UTC (rev 9) @@ -13,7 +13,7 @@ 'path' => __FILE__, 'name' => 'Wikimedia Incubator', 'author' => array('SPQRobin', 'Hydriz'), - 'version' => '3.1.0-dev', + 'version' => 'dev, synced to 3.1.1 in svn', 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator', 'descriptionmsg' => 'wminc-desc', ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-06-01 21:11:31
|
Revision: 8 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=8&view=rev Author: robin-p Date: 2011-06-01 21:11:25 +0000 (Wed, 01 Jun 2011) Log Message: ----------- prevent Notice undefined index Modified Paths: -------------- trunk/IncubatorTest.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-05-31 03:21:11 UTC (rev 7) +++ trunk/IncubatorTest.php 2011-06-01 21:11:25 UTC (rev 8) @@ -76,7 +76,7 @@ if( !is_array( $titleparts ) || !isset( $titleparts[1] ) ) { $data['error'] = 'noslash'; } else { - $data['project'] = $titleparts[0][1]; // get the x from Wx/... + $data['project'] = ( isset( $titleparts[0][1] ) ? $titleparts[0][1] : '' ); // get the x from Wx/... $data['lang'] = $titleparts[1]; $data['prefix'] = 'W'.$data['project'].'/'.$data['lang']; // check language code This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hy...@us...> - 2011-05-31 03:21:17
|
Revision: 7 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=7&view=rev Author: hydria Date: 2011-05-31 03:21:11 +0000 (Tue, 31 May 2011) Log Message: ----------- Add message entry Modified Paths: -------------- trunk/WikimediaIncubator.i18n.php Modified: trunk/WikimediaIncubator.i18n.php =================================================================== --- trunk/WikimediaIncubator.i18n.php 2011-05-30 16:14:53 UTC (rev 6) +++ trunk/WikimediaIncubator.i18n.php 2011-05-31 03:21:11 UTC (rev 7) @@ -32,6 +32,7 @@ 'randombytest-nopages' => 'There are no pages in your test wiki, in the namespace: $1.', 'wminc-recentchanges-all' => 'All recent changes', 'wminc-testwikiexport' => 'Export pages from a test wiki', + 'wminc-requestwiki' => 'Request a new wiki', ); /** Message documentation (Message documentation) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-05-30 16:14:59
|
Revision: 6 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=6&view=rev Author: robin-p Date: 2011-05-30 16:14:53 +0000 (Mon, 30 May 2011) Log Message: ----------- add $wmincScriptDir to WikimediaIncubator.php Modified Paths: -------------- trunk/IncubatorTest.php trunk/InfoPage.php trunk/WikimediaIncubator.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2011-05-30 15:09:38 UTC (rev 5) +++ trunk/IncubatorTest.php 2011-05-30 16:14:53 UTC (rev 6) @@ -336,9 +336,8 @@ if( isset( $prefixdata['error'] ) || $ns != NS_MAIN ) { return true; } - global $wgOut, $wmincProjects, $wgNames, $wmincSisterProjects, $wgScriptPath; - // ### NEED TO FIX THIS: DO NOT HARDCODE EXTENSION PATH!! ### - $wgOut->addExtensionStyle( $wgScriptPath.'/extensions/WikimediaIncubator-dev/InfoPage.css' ); + global $wgOut, $wmincProjects, $wgNames, $wmincSisterProjects, $wmincScriptDir; + $wgOut->addExtensionStyle( $wmincScriptDir.'InfoPage.css' ); $languages = self::getLanguageNames(); $projectcode = $prefixdata['project']; $langcode = $prefixdata['lang']; Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-05-30 15:09:38 UTC (rev 5) +++ trunk/InfoPage.php 2011-05-30 16:14:53 UTC (rev 6) @@ -12,10 +12,10 @@ public static function render( &$parser, $status='default', $meta=false, $mainpage='', $created='', $bug='', $wparticle='', $since='' ) { - global $wgTitle, $wgOut, $wgScriptPath; + global $wgTitle, $wgOut, $wmincScriptDir; // ### NEED TO FIX THIS: DO NOT HARDCODE EXTENSION PATH!! ### // Only loads when editing pages??? - $wgOut->addExtensionStyle( $wgScriptPath.'/extensions/WikimediaIncubator-dev/InfoPage.css' ); + $wgOut->addExtensionStyle( $wmincScriptDir.'InfoPage.css' ); if(!preg_match('/W[bnpqt]\/[a-z][a-z][a-z]?/', $wgTitle)) { return '<div class="error">ERROR (#infopage): Page title is not in Wx/xx(x) format.</div>'; } Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2011-05-30 15:09:38 UTC (rev 5) +++ trunk/WikimediaIncubator.php 2011-05-30 16:14:53 UTC (rev 6) @@ -25,6 +25,9 @@ /* General (globals and/or configuration) */ $wmincPref = 'incubatortestwiki'; // Name of the preference $dir = dirname( __FILE__ ) . '/'; +// ### WE NEED TO FIND A GOOD WAY TO MAKE THIS AUTOMATIC ### +// ### it should return the web URL and not the location on the server (so dirname does not work) +$wmincScriptDir = $wgScriptPath.'/extensions/WikimediaIncubator-dev/trunk/'; // only one-letter codes can be used for projects $wmincProjects = array( 'Wikipedia' => 'p', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2011-05-30 15:09:44
|
Revision: 5 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=5&view=rev Author: robin-p Date: 2011-05-30 15:09:38 +0000 (Mon, 30 May 2011) Log Message: ----------- Revert revision 4: this does not work (I tried it before) Revision Links: -------------- http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=4&view=rev Modified Paths: -------------- trunk/InfoPage.php Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-05-30 04:47:05 UTC (rev 4) +++ trunk/InfoPage.php 2011-05-30 15:09:38 UTC (rev 5) @@ -1,5 +1,4 @@ <?php -$wmiExtPath = dirname( __FILE__ ); // Initialise location path of extension class InfoPage { public static function setup( &$parser ) { $parser->setFunctionHook( 'infopage', 'InfoPage::render' ); @@ -14,9 +13,9 @@ public static function render( &$parser, $status='default', $meta=false, $mainpage='', $created='', $bug='', $wparticle='', $since='' ) { global $wgTitle, $wgOut, $wgScriptPath; - // ### NEED TO FIX THIS: DO NOT HARDCODE EXTENSION PATH!! ### <--- Fixed above + // ### NEED TO FIX THIS: DO NOT HARDCODE EXTENSION PATH!! ### // Only loads when editing pages??? - $wgOut->addExtensionStyle( $wmiExtPath.'/InfoPage.css' ); + $wgOut->addExtensionStyle( $wgScriptPath.'/extensions/WikimediaIncubator-dev/InfoPage.css' ); if(!preg_match('/W[bnpqt]\/[a-z][a-z][a-z]?/', $wgTitle)) { return '<div class="error">ERROR (#infopage): Page title is not in Wx/xx(x) format.</div>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hy...@us...> - 2011-05-30 04:47:11
|
Revision: 4 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=4&view=rev Author: hydria Date: 2011-05-30 04:47:05 +0000 (Mon, 30 May 2011) Log Message: ----------- Fix path Modified Paths: -------------- trunk/InfoPage.php Modified: trunk/InfoPage.php =================================================================== --- trunk/InfoPage.php 2011-05-29 17:08:32 UTC (rev 3) +++ trunk/InfoPage.php 2011-05-30 04:47:05 UTC (rev 4) @@ -1,4 +1,5 @@ <?php +$wmiExtPath = dirname( __FILE__ ); // Initialise location path of extension class InfoPage { public static function setup( &$parser ) { $parser->setFunctionHook( 'infopage', 'InfoPage::render' ); @@ -13,9 +14,9 @@ public static function render( &$parser, $status='default', $meta=false, $mainpage='', $created='', $bug='', $wparticle='', $since='' ) { global $wgTitle, $wgOut, $wgScriptPath; - // ### NEED TO FIX THIS: DO NOT HARDCODE EXTENSION PATH!! ### + // ### NEED TO FIX THIS: DO NOT HARDCODE EXTENSION PATH!! ### <--- Fixed above // Only loads when editing pages??? - $wgOut->addExtensionStyle( $wgScriptPath.'/extensions/WikimediaIncubator-dev/InfoPage.css' ); + $wgOut->addExtensionStyle( $wmiExtPath.'/InfoPage.css' ); if(!preg_match('/W[bnpqt]\/[a-z][a-z][a-z]?/', $wgTitle)) { return '<div class="error">ERROR (#infopage): Page title is not in Wx/xx(x) format.</div>'; } @@ -185,4 +186,4 @@ default: return 'Level not recognized'; break; } } -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |