public function getCurrentLanguage() {
		if ( $this->currentLang === null ) {
			$lang = $this->defaultLanguage;
			if ( isset( $_REQUEST['uselang'] ) ) {
				$lang = $_REQUEST['uselang'];

			} elseif ( isset( $_SESSION['uselang'] ) ) {
				$lang = $_SESSION['uselang'];

			} else {
				$wants = self::parseAcceptLanguage();
				$bestMatches = array_intersect(
					$wants, $this->getAvailableLanguages()
				);
				if ( $bestMatches ) {
					$lang = current( $bestMatches );
				}
			}

			$this->setCurrentLanguage( $lang );
		}
		return $this->currentLang;
	}
public function getCurrentLanguage() {
		if ( $this->currentLang === null ) {
			$lang = $this->defaultLanguage;
			if ( isset( $_REQUEST['uselang'] ) ) {
				$lang = $_REQUEST['uselang'];

			} elseif ( isset( $_SESSION['uselang'] ) ) {
				$lang = $_SESSION['uselang'];

			} else {
				$wants = self::parseAcceptLanguage();
				$bestMatches = array_intersect(
					$wants, $this->getAvailableLanguages()
				);
				if ( $bestMatches ) {
					$lang = current( $bestMatches );
				}
			}

			$this->setCurrentLanguage( $lang );
		}
		return $this->currentLang;
	}
public function getCurrentLanguage ( ) { if ( $ this -> currentLang === null ) { $ lang = $ this -> defaultLanguage ; if ( isset ( $ _REQUEST [ 'uselang' ] ) ) { $ lang = $ _REQUEST [ 'uselang' ] ; } elseif ( isset ( $ _SESSION [ 'uselang' ] ) ) { $ lang = $ _SESSION [ 'uselang' ] ; } else { $ wants = self :: parseAcceptLanguage ( ) ; $ bestMatches = array_intersect ( $ wants , $ this -> getAvailableLanguages ( ) ) ; if ( $ bestMatches ) { $ lang = current ( $ bestMatches ) ; } } $ this -> setCurrentLanguage ( $ lang ) ; } return $ this -> currentLang ; }
Get current language.

If no language has been set or detected, this will attempt to detect
the user's preferred language by examining the current request, session
and HTTP headers.

The key 'uselang' is checked in the HTTP request and PHP session. If
not set in either, the Accept-Language header from the request is
parsed to determine potential langauges to select. In all cases, the
current list of known localizations is consulted and if no match is
found, the configured system wide default language is used as
a fallback.

@return string
Get current language .