Checks to see if the current user object is registered. If so, it queries that records
default language. Otherwise, it falls back to sitewide settings.

@return string
822
public function getUserLanguageToDisplay()
    {
        if ($this->getUserDefaultLanguage() != '') {
            return $this->getUserDefaultLanguage();
        } else {
            $app = Application::getFacadeApplication();
            $config = $app['config'];

            return $config->get('concrete.locale');
        }
    }
1079314
protected function locale()
    {
        if (($member = Member::currentUser()) && $member->Locale) {
            return $member->Locale;
        }
            
        return i18n::get_locale();
    }
866908
public static function getCurrentLanguage(){
		if(!self::$current_language){
			$language = CSession::get(self::CURRENT_LANGUAGE);
			if(!$language){
				$language = 'en_US';
			}
			self::$current_language = $language;
		}
		return self::$current_language;
	}
1233236
public function getDefaultReport()
    {
        // User preference: default website ID to load
        $defaultReport = $this->api->getUserPreference(Piwik::getCurrentUserLogin(), APIUsersManager::PREFERENCE_DEFAULT_REPORT);

        if (!is_numeric($defaultReport)) {
            return $defaultReport;
        }

        if ($defaultReport && Piwik::isUserHasViewAccess($defaultReport)) {
            return $defaultReport;
        }

        return false;
    }
1314610
protected function getCurrentLang(){
        if(!Yii::$app->user->isGuest && !empty(Yii::$app->user->identity->lang)) {
            $lang = Yii::$app->user->identity->lang;
        } else if(Yii::$app->session->get('lang')) {
            $lang = Yii::$app->session->get('lang');
        } else {
            $lang = Yii::$app->getRequest()->getPreferredLanguage();
        }
        
        return $lang;
    }
364028
public function getLanguage()
    {
        if (!is_array($this->languages)) {
            LanguageDetector::detect($this, $this->getAcceptLanguage());
        }

        return strtolower(substr(reset($this->languages), 0, 2));
    }
734396
public function getBackOfficeLanguage()
    {
        $currentLanguage = $this->session->get(self::KEY_LOCALE);

        if (!$currentLanguage) {
            $currentLanguage = $this->defaultLocale;
            $token = $this->tokenStorage->getToken();
            if ($token && ($user = $token->getUser()) instanceof UserInterface) {
                if (null !== $user->getLanguage()) {
                    $currentLanguage = $user->getLanguage();
                }
                $this->setBackOfficeLanguage($currentLanguage);
            }
        }

        return $currentLanguage;

    }
1044277
protected function validateLanguage()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->language->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('Language'));
            return false;
        }

        $this->setUpdating($data);
        return true;
    }
364189
public function getInterfaceLanguage()
    {
        return $this->getIsGuest() ? $this->defaultLanguage : $this->identity->setting->get('luyadminlanguage', $this->defaultLanguage);
    }
311939
public static function getLocale()
    {
        static::getDefaultLocale();
        $current = Locale::getDefault();
        if ($current === '') {
            $current = static::DEFAULT_LOCALE;
            Locale::setDefault($current);
        }

        return $current;
    }
584248
public static function getDefaultLanguage()
    {
        if (!is_null(self::$defaultLanguage)) {
            return self::$defaultLanguage;
        }

        if (!file_exists(self::$defaultLanguageFile)) {
            throw new \LogicException('Default language file '.self::$defaultLanguageFile.' does not exist');
        }

        self::$defaultLanguage = file_get_contents(self::$defaultLanguageFile);
        return self::$defaultLanguage;
    }
22230
protected function _getCurrentLanguage() {
        if (!isset($_SERVER['REQUEST_URI'])) {
            // Probably CLI context. Return the default locale
            return Garp_I18n::getDefaultLocale();
        }
        $requestUri = $_SERVER['REQUEST_URI'];
        $bits = explode('/', $requestUri);
        // remove empty values
        $bits = array_filter($bits, 'strlen');
        // reindex the array
        $bits = array_values($bits);
        $bits = array_map('strtolower', $bits);
        $locales = $this->_getPossibleLocales();
        if (array_key_exists(0, $bits) && in_array($bits[0], $locales)) {
            return $bits[0];
        }
        return Garp_I18n::getDefaultLocale();
    }
739322
public function getLanguage()
    {
        if ($this->project->getEmailMultiLanguage() && $this->language) {
            return $this->language;
        } else {
            return $this->project->getLocaleDefault();
        }
    }
553463
public function getAcceptLanguage() 
    {
        if (!$this->language) {
            $language = explode(',', $this->getServer('HTTP_ACCEPT_LANGUAGE', ''));
            $this->language = $language[0] ? $language[0] : 'zh-cn';
        }
        
        return $this->language;
    }
1264703
public function detectCurrentLanguage()
    {
        // parsing url to get only path & removing prefix if there is one
        $escapedPathPrefix = Text::escapeForRegex($this->config->getPathPrefix());
        $uriPath = parse_url($this->config->getRaw(), PHP_URL_PATH);
        $uriPath = preg_replace('/^' . $escapedPathPrefix . '/s', '', $uriPath);
        $uriSegments = explode('/', $uriPath);

        if (isset($uriSegments[1]) && in_array($uriSegments[1], $this->translate->getLanguages())) {
            return $uriSegments[1];
        }
        return $this->translate->getDefault();
    }
859658
public function userLanguages() {
        if (isset($this->serverVariables['HTTP_ACCEPT_LANGUAGE'])) {
            preg_match_all(
                '/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i',
                $this->serverVariables['HTTP_ACCEPT_LANGUAGE'],
                $matches
            );

            if (count($matches[1])) {
                $result = array_combine($matches[1], $matches[4]);

                array_walk($result, function($lang, $amount) {
                    if ($amount === '') {
                        $langs[$lang] = 1;
                    }
                });

                arsort($result, \SORT_NUMERIC);

                return $result;
            }
        }

        return array();
    }
1332832
public function getLanguage()
    {
        if(!$language = $this->getUser()->getLanguage()) {
            $language = $this->getConfig()->language;
        }

        return $language;
    }