/** * Helper method to get all messages * * @param Language $lang - Language object to get all messages from * @return array - list of all message keys */ private static function getAllMessageKeys(Language $lang) { wfProfileIn(__METHOD__); if (is_null(self::$allMessageKeys)) { wfProfileIn(__METHOD__ . '::miss'); $messageKeys = $lang->getAllMessageKeys(); self::$allMessageKeys = $messageKeys['messages']; $langCode = $lang->getCode(); // append legacy data if (isset(Language::$dataCache->legacyData[$langCode]['messages'])) { self::$allMessageKeys = array_unique(array_keys(Language::$dataCache->legacyData[$langCode]['messages']), self::$allMessageKeys); } wfProfileOut(__METHOD__ . '::miss'); } wfProfileOut(__METHOD__); return self::$allMessageKeys; }