r75952 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75951‎ | r75952 | r75953 >
Date:19:06, 3 November 2010
Author:kaldari
Status:ok
Tags:
Comment:
support for chained fallback languages
Modified paths:
  • /trunk/extensions/LandingCheck/SpecialLandingCheck.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LandingCheck/SpecialLandingCheck.php
@@ -35,11 +35,13 @@
3636 // Build array of landing pages to check for
3737 $targetTexts = array(
3838 $landingPage . '/' . $language . '/' . $country,
39 - $landingPage . '/' . $language,
40 - $landingPage . '/' . Language::getFallbackFor( $language )
 39+ $landingPage . '/' . $language
4140 );
42 - if ( $language != 'en' ) {
43 - $targetTexts[] = $landingPage . '/en'; // English fallback
 41+ // Add fallback languages
 42+ $code = $language;
 43+ while ( $code !== 'en' ) {
 44+ $code = Language::getFallbackFor( $code );
 45+ $targetTexts[] = $landingPage . '/' . $code;
4446 }
4547
4648 // Go through the possible landing pages and redirect the user as soon as one is found to exist

Follow-up revisions

RevisionCommit summaryAuthorDate
r75956mft r75952 and r7591nimishg20:46, 3 November 2010

Status & tagging log