src/Translator/Traits/LegacyCodeTrait.php
public function getDefaultLanguage()
    {
        if (!$this->defaultLanguage) {
            $language = substr(setlocale(LC_ALL, 0), 0, 2);
            $languages = $this->getLanguages();
            $languageDefault = reset($languages);
            $language = $this->isValidLanguage($language) ? $language : $languageDefault;
            $this->setDefaultLanguage($language);
        }

        return $this->defaultLanguage;
    }
public function getDefaultLanguage()
    {
        if (!$this->defaultLanguage) {
            $language = substr(setlocale(LC_ALL, 0), 0, 2);
            $languages = $this->getLanguages();
            $languageDefault = reset($languages);
            $language = $this->isValidLanguage($language) ? $language : $languageDefault;
            $this->setDefaultLanguage($language);
        }

        return $this->defaultLanguage;
    }
public function getDefaultLanguage ( ) { if ( ! $ this -> defaultLanguage ) { $ language = substr ( setlocale ( LC_ALL , 0 ) , 0 , 2 ) ; $ languages = $ this -> getLanguages ( ) ; $ languageDefault = reset ( $ languages ) ; $ language = $ this -> isValidLanguage ( $ language ) ? $ language : $ languageDefault ; $ this -> setDefaultLanguage ( $ language ) ; } return $ this -> defaultLanguage ; }
gets the default language to be used when translating
@return boolean $language
gets the default language to be used when translating