public static function setUILanguage($lang)
 {
     global $wgLanguageCode, $wgLang, $wgLangClass;
     global $mgVersion;
     if ($mgVersion < 10800) {
         $wgLangClass = 'Language' . str_replace('-', '_', ucfirst($lang));
         $wgLang = setupLangObj($wgLangClass);
         $wgLang->initEncoding();
         $wgLanguageCode = $wgLang->getCode();
     } else {
         $wgLang = Language::factory($lang);
         $wgLanguageCode = $wgLang->getCode();
     }
 }
Beispiel #2
0
     $wgLanguageCode = $wgUser->getOption('language');
 }
 # Validate $wgLanguageCode, which will soon be sent to an eval()
 if (empty($wgLanguageCode) || !preg_match('/^[a-z]+(-[a-z]+)?$/', $wgLanguageCode)) {
     $wgLanguageCode = $wgContLanguageCode;
 }
 $wgLangClass = 'Language' . str_replace('-', '_', ucfirst($wgLanguageCode));
 if ($wgLangClass == $wgContLangClass) {
     $wgLang =& $wgContLang;
 } else {
     wfSuppressWarnings();
     // Preload base classes to work around APC/PHP5 bug
     include_once "{$IP}/languages/{$wgLangClass}.deps.php";
     include_once "{$IP}/languages/{$wgLangClass}.php";
     wfRestoreWarnings();
     $wgLang = setupLangObj($wgLangClass);
 }
 wfProfileOut($fname . '-language2');
 wfProfileIn($fname . '-MessageCache');
 $wgMessageCache = new MessageCache($parserMemc, $wgUseDatabaseMessages, $wgMsgCacheExpiry, $wgDBname);
 wfProfileOut($fname . '-MessageCache');
 #
 # I guess the warning about UI switching might still apply...
 #
 # FIXME: THE ABOVE MIGHT BREAK NAMESPACES, VARIABLES,
 # SEARCH INDEX UPDATES, AND MANY MANY THINGS.
 # DO NOT USE THIS MODE EXCEPT FOR TESTING RIGHT NOW.
 #
 # To disable it, the easiest thing could be to uncomment the
 # following; they should effectively disable the UI switch functionality
 #
 /**
  * Constructor
  */
 function SpecialVersion()
 {
     // English m**********r, do you speak it?
     $this->langObj = setupLangObj('LanguageEn');
     $this->langObj->initEncoding();
 }