public function getLanguageLocale($separator = '-')
    {
        if (!is_array($this->languages)) {
            LanguageDetector::detect($this, $this->getAcceptLanguage());
        }

        $userLanguage = $this->getLanguage();
        foreach ($this->languages as $language) {
            if (strlen($language) === 5 && strpos($language, $userLanguage) === 0) {
                $locale = substr($language, -2);
                break;
            }
        }

        if (!empty($locale)) {
            return $userLanguage . $separator . strtoupper($locale);
        } else {
            return $userLanguage;
        }
    }
public function getLanguageLocale($separator = '-')
    {
        if (!is_array($this->languages)) {
            LanguageDetector::detect($this, $this->getAcceptLanguage());
        }

        $userLanguage = $this->getLanguage();
        foreach ($this->languages as $language) {
            if (strlen($language) === 5 && strpos($language, $userLanguage) === 0) {
                $locale = substr($language, -2);
                break;
            }
        }

        if (!empty($locale)) {
            return $userLanguage . $separator . strtoupper($locale);
        } else {
            return $userLanguage;
        }
    }
public function getLanguageLocale ( $ separator = '-' ) { if ( ! is_array ( $ this -> languages ) ) { LanguageDetector :: detect ( $ this , $ this -> getAcceptLanguage ( ) ) ; } $ userLanguage = $ this -> getLanguage ( ) ; foreach ( $ this -> languages as $ language ) { if ( strlen ( $ language ) === 5 && strpos ( $ language , $ userLanguage ) === 0 ) { $ locale = substr ( $ language , - 2 ) ; break ; } } if ( ! empty ( $ locale ) ) { return $ userLanguage . $ separator . strtoupper ( $ locale ) ; } else { return $ userLanguage ; } }
Get a user's language and locale.

@param string $separator

@return string
Get a user s language and locale .