/** * @param $purge purge cache * @return array of language names for the user's language preference **/ function getOwLanguageNames( $purge = false ) { global $wgLang ; static $owLanguageNames = null; if ( is_null( $owLanguageNames ) && !$purge ) { $owLanguageNames = getLangNames( $wgLang->getCode() ); } return $owLanguageNames; }
function getLanguageOptions( $languageIdsToExclude = array() ) { global $wgLang ; $userLanguage = $wgLang->getCode(); $idNameIndex = getLangNames( $userLanguage ); $result = array(); foreach ( $idNameIndex as $id => $name ) if ( !in_array( $id, $languageIdsToExclude ) ) $result[$id] = $name; return $result; }