/** * Add words from: * * $wgSpellCheckerExtraWordsGlobal * * $wgSpellCheckerExtraWords(langcode) * * MediaWiki:Dictionary message * to current dictionary (for this session only) */ private function addExtraWords() { wfProfileIn(__METHOD__); $words = array(); // add "global" extra words $words = array_merge($words, (array) $this->app->getGlobal('wgSpellCheckerExtraWordsGlobal')); // add "per language" extra words $variableName = 'wgSpellCheckerExtraWords' . ucfirst($this->lang); $words = array_merge($words, (array) $this->app->getGlobal($variableName)); // add "per wiki: extra words (from MediaWiki:Dictionary) $localDictionary = Wikia::parseMessageToArray('dictionary', true); $words = array_merge($words, $localDictionary); // remove duplicated words $words = array_unique($words); //var_dump($words); if (!empty($words)) { foreach ($words as $word) { $this->dict->addWord($word); } $wordsCount = count($words); wfDebug(__METHOD__ . ": {$wordsCount} extra words added to the dictionary\n"); } wfProfileOut(__METHOD__); }