public static function set($lang = NULL) {
        $languages = get_config('langs');
        if (!$languages) {
            throw new \Exception(ExceptionMessages::MISCONFIGURED_LANG_CONFIG);
        }

        if (!get_config('lang_default')) {
            throw new \Exception(ExceptionMessages::MISCONFIGURED_LANG_DEFAULT_CONFIG);
        }

        if (empty($lang) || !in_array($lang, $languages)) {
            $lang = get_config('lang_default');
        }

        self::$currentLang = $lang;
        self::load($lang);
    }
public static function set($lang = NULL) {
        $languages = get_config('langs');
        if (!$languages) {
            throw new \Exception(ExceptionMessages::MISCONFIGURED_LANG_CONFIG);
        }

        if (!get_config('lang_default')) {
            throw new \Exception(ExceptionMessages::MISCONFIGURED_LANG_DEFAULT_CONFIG);
        }

        if (empty($lang) || !in_array($lang, $languages)) {
            $lang = get_config('lang_default');
        }

        self::$currentLang = $lang;
        self::load($lang);
    }
public static function set ( $ lang = NULL ) { $ languages = get_config ( 'langs' ) ; if ( ! $ languages ) { throw new \ Exception ( ExceptionMessages :: MISCONFIGURED_LANG_CONFIG ) ; } if ( ! get_config ( 'lang_default' ) ) { throw new \ Exception ( ExceptionMessages :: MISCONFIGURED_LANG_DEFAULT_CONFIG ) ; } if ( empty ( $ lang ) || ! in_array ( $ lang , $ languages ) ) { $ lang = get_config ( 'lang_default' ) ; } self :: $ currentLang = $ lang ; self :: load ( $ lang ) ; }
Sets current language

@param string $lang
@return void
@throws \Exception
Sets current language