From: Mr. E23 Date: Sun, 1 Feb 2004 22:00:06 +0000 (+0000) Subject: Elegant solution for the problem with separate lists of special pages language files X-Git-Tag: 1.3.0beta1~1038 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=e9af0ffb248e86ac69700c6f75016f54e27cbbe6;p=lhc%2Fweb%2Fwiklou.git Elegant solution for the problem with separate lists of special pages language files --- diff --git a/languages/Language.php b/languages/Language.php index e2d1e5cd77..5ba3f88d24 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1352,6 +1352,24 @@ amusement.", #-------------------------------------------------------------------------- class Language { + function Language(){ + # Copies any missing values in the specified arrays from En to the current language + $fillin = array( "wgSysopSpecialPages", "wgValidSpecialPages", "wgDeveloperSpecialPages" ); + $name = get_class( $this ); + if( strpos( $name, "language" ) == 0){ + $lang = ucfirst( substr( $name, 8 ) ); + foreach( $fillin as $arrname ){ + $langver = "{$arrname}{$lang}"; + $enver = "{$arrname}En"; + if( ! isset( $GLOBALS[$langver] ) || ! isset( $GLOBALS[$enver] )) + continue; + foreach($GLOBALS[$enver] as $spage => $text){ + if( ! isset( $GLOBALS[$langver][$spage] ) ) + $GLOBALS[$langver][$spage] = $text; + } + } + } + } function getDefaultUserOptions () { global $wgDefaultUserOptionsEn ;