From: Robin Pepermans Date: Sat, 19 Nov 2011 05:18:32 +0000 (+0000) Subject: Make $wgDummyLanguageCodes an associative array so it maps to the correct codes;... X-Git-Tag: 1.31.0-rc.0~26431 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=4775997ec404c372c2f40ae23cc53de853cda542;p=lhc%2Fweb%2Fwiklou.git Make $wgDummyLanguageCodes an associative array so it maps to the correct codes; and use it in WikimediaIncubator to check whether the wiki exists (so e.g. Wx/sgs recognizes that the wiki corresponding to Wx/bat-smg exists). The extension is compatible with the old $wgDummyLanguageCodes array. --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index d741b1ba6f..65b9eb1fae 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1876,19 +1876,19 @@ $wgExtraLanguageNames = array(); * and excludes them when running the transstat.php script. */ $wgDummyLanguageCodes = array( - 'als', # => 'gsw' - 'bat-smg', # => 'sgs' - 'be-x-old', # => 'be-tarask' - 'bh', # => 'bho' - 'fiu-vro', # => 'vro' - 'nb', # => 'no' - 'qqq', # Used for message documentation. - 'qqx', # Used for viewing message keys. - 'roa-rup', # => 'rup' - 'simple', # => 'en' - 'zh-classical', # => 'lzh' - 'zh-min-nan', # => 'nan' - 'zh-yue', # => 'yue' + 'als' => 'gsw', + 'bat-smg' => 'sgs', + 'be-x-old' => 'be-tarask', + 'bh' => 'bho', + 'fiu-vro' => 'vro', + 'nb' => 'no', + 'qqq' => 'qqq', # Used for message documentation. + 'qqx' => 'qqx', # Used for viewing message keys. + 'roa-rup' => 'rup', + 'simple' => 'en', + 'zh-classical' => 'lzh', + 'zh-min-nan' => 'nan', + 'zh-yue' => 'yue', ); /** diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 387001eb31..9237ee34d8 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -234,9 +234,8 @@ class WebInstaller_Language extends WebInstallerPage { $languages = Language::getLanguageNames(); ksort( $languages ); - $dummies = array_flip( $wgDummyLanguageCodes ); foreach ( $languages as $code => $lang ) { - if ( isset( $dummies[$code] ) ) continue; + if ( isset( $wgDummyLanguageCodes[$code] ) ) continue; $s .= "\n" . Xml::option( "$code - $lang", $code, $code == $selectedCode ); } $s .= "\n\n"; diff --git a/maintenance/language/transstat.php b/maintenance/language/transstat.php index 6063cb961e..fb08b7d02a 100644 --- a/maintenance/language/transstat.php +++ b/maintenance/language/transstat.php @@ -97,7 +97,7 @@ $wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] ); foreach ( $wgLanguages->getLanguages() as $code ) { # Don't check English, RTL English or dummy language codes if ( $code == 'en' || $code == 'enRTL' || (is_array( $wgDummyLanguageCodes ) && - in_array( $code, $wgDummyLanguageCodes ) ) ) { + isset( $wgDummyLanguageCodes[$code] ) ) ) { continue; }