diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index 94007501..f1ad9e83 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -72,7 +72,9 @@ class UniversalLanguageSelectorHooks { } protected static function isSupportedLanguage( $language ) { + wfProfileIn( __METHOD__ ); $supported = Language::fetchLanguageNames( null, 'mwfile' ); + wfProfileOut( __METHOD__ ); return isset( $supported[$language] ); } @@ -81,11 +83,13 @@ class UniversalLanguageSelectorHooks { * @return string */ protected static function getDefaultLanguage( array $preferred ) { + wfProfileIn( __METHOD__ ); $supported = Language::fetchLanguageNames( null, 'mwfile' ); // look for a language that is acceptable to the client // and known to the wiki. foreach ( $preferred as $code => $weight ) { if ( isset( $supported[$code] ) ) { + wfProfileOut( __METHOD__ ); return $code; } } @@ -96,10 +100,12 @@ class UniversalLanguageSelectorHooks { $parts = explode( '-', $code, 2 ); $code = $parts[0]; if ( isset( $supported[$code] ) ) { + wfProfileOut( __METHOD__ ); return $code; } } + wfProfileOut( __METHOD__ ); return ""; }