RainLab\Translate\Classes\Translator::loadLocaleFromRequest PHP Method

loadLocaleFromRequest() public method

Sets the locale based on the first URI segment.
public loadLocaleFromRequest ( ) : boolean
return boolean
    public function loadLocaleFromRequest()
    {
        $locale = Request::segment(1);
        if (!Locale::isValid($locale)) {
            return false;
        }
        $this->setLocale($locale);
        return true;
    }