r96138 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96137‎ | r96138 | r96139 >
Date:18:18, 2 September 2011
Author:robin
Status:ok
Tags:
Comment:
* Call core function Language::getTranslatedLanguageName() if found, instead of CLDR extension. Exists since v1.18.
* Fix r95582 & r96122: only load code for ListUsers if higher than v1.17 (because it doesn't work in 1.17).
This keeps backwards-compatibility with 1.17, but loads more features in 1.18+.
Modified paths:
  • /trunk/extensions/WikimediaIncubator/IncubatorTest.php (modified) (history)
  • /trunk/extensions/WikimediaIncubator/WikimediaIncubator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.php
@@ -14,7 +14,7 @@
1515 'path' => __FILE__,
1616 'name' => 'Wikimedia Incubator',
1717 'author' => 'SPQRobin',
18 - 'version' => '4.3.2',
 18+ 'version' => '4.4',
1919 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator',
2020 'descriptionmsg' => 'wminc-desc',
2121 );
@@ -143,7 +143,9 @@
144144 $wgHooks['PageContentLanguage'][] = 'IncubatorTest::onPageContentLanguage';
145145
146146 /* List of users */
147 -$wgAutoloadClasses['ListUsersTestWiki'] = $dir . 'ListUsersTestWiki.php';
148 -$wgHooks['SpecialListusersHeaderForm'][] = 'ListUsersTestWiki::onSpecialListusersHeaderForm';
149 -$wgHooks['SpecialListusersQueryInfo'][] = 'ListUsersTestWiki::onSpecialListusersQueryInfo';
150 -$wgHooks['SpecialListusersHeader'][] = 'ListUsersTestWiki::onSpecialListusersHeader';
 147+if( version_compare( $wgVersion, '1.17', '>' ) ) { # doesn't work below 1.18
 148+ $wgAutoloadClasses['ListUsersTestWiki'] = $dir . 'ListUsersTestWiki.php';
 149+ $wgHooks['SpecialListusersHeaderForm'][] = 'ListUsersTestWiki::onSpecialListusersHeaderForm';
 150+ $wgHooks['SpecialListusersQueryInfo'][] = 'ListUsersTestWiki::onSpecialListusersQueryInfo';
 151+ $wgHooks['SpecialListusersHeader'][] = 'ListUsersTestWiki::onSpecialListusersHeader';
 152+}
\ No newline at end of file
Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php
@@ -379,16 +379,13 @@
380380
381381 /**
382382 * This loads language names. Also from CLDR if that extension is found.
383 - * @return Array with language names or empty array
 383+ * @return Array with language names
384384 */
385 - static public function getLanguageNames( $code = '' ) {
386 - if ( is_callable( array( 'LanguageNames', 'getNames' ) ) ) {
 385+ static public function getLanguageNames( $code = null ) {
 386+ if ( is_callable( array( 'Language', 'getTranslatedLanguageNames' ) ) ) {
387387 global $wgLang;
388388 $langcode = ( $code ? $code : $wgLang->getCode() );
389 - return LanguageNames::getNames( $langcode,
390 - LanguageNames::FALLBACK_NORMAL,
391 - LanguageNames::LIST_MW_AND_CLDR
392 - );
 389+ return Language::getTranslatedLanguageNames( $langcode );
393390 }
394391 return Language::getLanguageNames( false );
395392 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r96141Drop support for 1.17 and below, as version_compare() doesn't work properly a...robin19:20, 2 September 2011
r105776MFT for WikimediaIncubator: r95582, r96122, r96138, r96141, r97175, r98670, r...siebrand00:32, 11 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95582Ability to filter list of users based on their test wiki preferencerobin23:24, 26 August 2011
r96122* Use more specific css for .subpages and mark it important, because it's ove...robin16:43, 2 September 2011

Status & tagging log