traits/helpers/TraitInitActiveLang.php
protected function initActiveLang()
    {
        if (self::$bLangInit || !PluginManager::instance()->hasPlugin('RainLab.Translate')) {
            return;
        }

        self::$bLangInit = true;
        $obTranslate = \RainLab\Translate\Classes\Translator::instance();

        self::$sDefaultLang = $obTranslate->getDefaultLocale();

        $sActiveLangCode = $obTranslate->getLocale();
        if (empty($sActiveLangCode) || $obTranslate->getDefaultLocale() == $sActiveLangCode) {
            return;
        }

        self::$sActiveLang = $sActiveLangCode;
    }
protected function initActiveLang()
    {
        if (self::$bLangInit || !PluginManager::instance()->hasPlugin('RainLab.Translate')) {
            return;
        }

        self::$bLangInit = true;
        $obTranslate = \RainLab\Translate\Classes\Translator::instance();

        self::$sDefaultLang = $obTranslate->getDefaultLocale();

        $sActiveLangCode = $obTranslate->getLocale();
        if (empty($sActiveLangCode) || $obTranslate->getDefaultLocale() == $sActiveLangCode) {
            return;
        }

        self::$sActiveLang = $sActiveLangCode;
    }
protected function initActiveLang ( ) { if ( self :: $ bLangInit || ! PluginManager :: instance ( ) -> hasPlugin ( 'RainLab.Translate' ) ) { return ; } self :: $ bLangInit = true ; $ obTranslate = \ RainLab \ Translate \ Classes \ Translator :: instance ( ) ; self :: $ sDefaultLang = $ obTranslate -> getDefaultLocale ( ) ; $ sActiveLangCode = $ obTranslate -> getLocale ( ) ; if ( empty ( $ sActiveLangCode ) || $ obTranslate -> getDefaultLocale ( ) == $ sActiveLangCode ) { return ; } self :: $ sActiveLang = $ sActiveLangCode ; }
Get and save active lang from Translate plugin
Get and save active lang from Translate plugin