src/Translator/Traits/LegacyCodeTrait.php
public function getLanguage()
    {
        if (!$this->selectedLanguage) {
            $language = false;

            if (isset($_SESSION['language']) && $this->isValidLanguage($_SESSION['language'])) {
                $language = $_SESSION['language'];
            }

            $requestLanguage = $this->getRequest()->get('language');
            if ($requestLanguage && $this->isValidLanguage($requestLanguage)) {
                $language = $requestLanguage;
            }

            if ($language) {
                $this->setLanguage($language);
            } else {
                $this->setLanguage($this->getDefaultLanguage());
            }
        }

        return $this->selectedLanguage;
    }
public function getLanguage()
    {
        if (!$this->selectedLanguage) {
            $language = false;

            if (isset($_SESSION['language']) && $this->isValidLanguage($_SESSION['language'])) {
                $language = $_SESSION['language'];
            }

            $requestLanguage = $this->getRequest()->get('language');
            if ($requestLanguage && $this->isValidLanguage($requestLanguage)) {
                $language = $requestLanguage;
            }

            if ($language) {
                $this->setLanguage($language);
            } else {
                $this->setLanguage($this->getDefaultLanguage());
            }
        }

        return $this->selectedLanguage;
    }
public function getLanguage ( ) { if ( ! $ this -> selectedLanguage ) { $ language = false ; if ( isset ( $ _SESSION [ 'language' ] ) && $ this -> isValidLanguage ( $ _SESSION [ 'language' ] ) ) { $ language = $ _SESSION [ 'language' ] ; } $ requestLanguage = $ this -> getRequest ( ) -> get ( 'language' ) ; if ( $ requestLanguage && $ this -> isValidLanguage ( $ requestLanguage ) ) { $ language = $ requestLanguage ; } if ( $ language ) { $ this -> setLanguage ( $ language ) ; } else { $ this -> setLanguage ( $ this -> getDefaultLanguage ( ) ) ; } } return $ this -> selectedLanguage ; }
Checks SESSION, GET and Nip_Request and selects requested language
If language not requested, falls back to default

@return string
@deprecated Use getLocale instead
Checks SESSION GET and Nip_Request and selects requested language If language not requested falls back to default