Returns currently active translation locale.

@return string
771034
public function activeLocale()
    {
        $active = $this->getCore()->session()->get(static::ACTIVE_LOCALE_SESSION_KEY);

        if ($active && in_array($active, $this->availableLocales())) {
            return $active;
        }

        return $this->defaultLocale();
    }
995708
public function getFallbackLanguages()
    {
        if (empty($this->fallback_languages)) {
            if ($this->enabled()) {
                $fallback_languages = $this->languages;

                if ($this->active) {
                    $active_extension = $this->active;
                    $key = \array_search($active_extension, $fallback_languages, true);
                    unset($fallback_languages[$key]);
                    array_unshift($fallback_languages, $active_extension);
                }
                $this->fallback_languages = $fallback_languages;
            }
            // always add english in case a translation doesn't exist
            $this->fallback_languages[] = 'en';
        }

        return $this->fallback_languages;
    }
453234
public function getLocale()
    {
        // Use the intl extension if present.
        if (class_exists('\Locale')) {
            $locale = \Locale::acceptFromHttp(@$_SERVER['HTTP_ACCEPT_LANGUAGE']);
        }

        // If no locale was obtained, resort to the default one.
        if (empty($locale)) {
            $locale = Application::getSettings()->locale->default;
        }

        return $locale;
    }
1348213
public function getClientPreferredLocale()
    {
        if (null !== $this->locale) {
            $locale = $this->locale;

        } else {
            // Get detector
            $detector = $this->getDetector();

            // Detect user's preferred locale
            $detector->detect();

            // get the locale from detector
            $locale = $detector->getLocale();
        }

        // return the active locale
        return $locale;
    }
153212
public function getCurrentLocale()
    {
        if (!$this->currentLocale instanceof Locale
            || $this->currentLocale->getLanguage() === 'mul') {
            return $this->defaultLocale;
        }
        return $this->currentLocale;
    }
241025
public function getTranslationsLocale()
    {
        $localeIso = $this->locale->getIso();

        if (isset($this->localeTranslationAssociations[$localeIso])) {
            return Locale::create($this->localeTranslationAssociations[$localeIso]);
        }

        return $this->locale;
    }
1234394
public function getDoubledLocale()
    {
        $locale = $this->getLocale();

        if (stristr($locale, '-') === false) {
            $locale = $locale.'-'.$locale;
        }

        return $locale;
    }
567726
public static function GetActiveCategoryQueryRestriction()
    {
        if (true === TGlobal::IsCMSMode()) {
            return '';
        }

        $databaseConnection = self::getConnection();
        $fieldTranslationUtil = self::getFieldTranslationUtil();
        $activeFieldName = $fieldTranslationUtil->getTranslatedFieldName('shop_category', 'active');
        $treeActiveFieldName = $fieldTranslationUtil->getTranslatedFieldName('shop_category', 'tree_active');

        return sprintf("(`shop_category`.%s = '1' AND `shop_category`.%s = '1')",
            $databaseConnection->quoteIdentifier($activeFieldName),
            $databaseConnection->quoteIdentifier($treeActiveFieldName)
        );
    }
436900
public function current()
    {
        $data = current($this->data);
        return Query::createItemObject($data, $this->lang, $this->getLoadedModel($data['id']));
    }
1021151
public function getObjectTplLanguage()
    {
        if ($this->_iObjectTplLanguageId === null) {
            $this->_iObjectTplLanguageId = $this->getTplLanguage();

            if ($this->isAdmin()) {
                $aLanguages = $this->getAdminTplLanguageArray();
                if (!isset($aLanguages[$this->_iObjectTplLanguageId]) ||
                    $aLanguages[$this->_iObjectTplLanguageId]->active == 0
                ) {
                    $this->_iObjectTplLanguageId = key($aLanguages);
                }
            }
        }

        return $this->_iObjectTplLanguageId;
    }
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;
	}
496399
public function t()
  {
      $args = func_get_args();
      $locales = count($this->supportedLocales);

      if (empty($args)) {
          return '';
      }

      if ($locales == 0) {
          return '';
      }

      if ($locales != count($args)) {
          $args = array_slice($args, 0, $locales);
      }

      if ($locales - count($args) > 0) {
          $args = array_merge($args, array_fill(0, $locales - count($args), ''));
      }

      $translations = array_combine($this->supportedLocales, $args);

      return $translations[$this->currentLocale];
  }
307994
public function getLocale(): string
    {
        if (is_null($this->locale)) {
            $this->locale = \Locale::getDefault();
        }

        return $this->locale;
    }
332017
public static function findActive()
    {
        if (self::$_langInstanceFindActive === null) {
            $langShortCode = Yii::$app->composition->getKey('langShortCode');
    
            if (!$langShortCode) {
                self::$_langInstanceFindActive = self::getDefault();
            } else {
                self::$_langInstanceFindActive = self::find()->where(['short_code' => $langShortCode, 'is_deleted' => false])->asArray()->one();
            }
        }
        
        return self::$_langInstanceFindActive;
    }
750052
public function getActiveLanguage()
    {
        if ($this->_activeLanguage === null) {
            $this->_activeLanguage = Lang::findActive();
        }
        
        return $this->_activeLanguage;
    }
260873
public function detectlocale()
    {
        if (isset($GLOBALS['lang'])) {
            return $GLOBALS['lang'];
        } elseif (getenv('LC_ALL')) {
            return getenv('LC_ALL');
        } elseif (getenv('LC_MESSAGES')) {
            return getenv('LC_MESSAGES');
        } elseif (getenv('LANG')) {
            return getenv('LANG');
        }

        return 'en';
    }
434210
public function getMainTranslation()
    {
        /** @var eZContentLanguage $language */
        $language = eZContentLanguage::fetch( $this->attribute( 'main_language_id' ) );
        if ( $language instanceof eZContentLanguage )
            return $this->translationByLocale( $language->attribute( 'locale' ) );

        return false;
    }