src/Titon/G11n/Route/LocaleRoute.php
public function compile() {
        if ($this->isCompiled()) {
            return $this->_compiled;
        }

        $g11n = G11n::registry();

        if ($g11n->isEnabled()) {
            if (mb_substr($this->getPath(), 0, 9) !== '/<locale>') {
                $this->prepend('/<locale>');
            }

            $this->setConfig('patterns.locale', self::LOCALE);
            $this->setConfig('locale', G11n::canonicalize($g11n->getFallback()->getCode()));
        }

        return parent::compile();
    }
public function compile() {
        if ($this->isCompiled()) {
            return $this->_compiled;
        }

        $g11n = G11n::registry();

        if ($g11n->isEnabled()) {
            if (mb_substr($this->getPath(), 0, 9) !== '/<locale>') {
                $this->prepend('/<locale>');
            }

            $this->setConfig('patterns.locale', self::LOCALE);
            $this->setConfig('locale', G11n::canonicalize($g11n->getFallback()->getCode()));
        }

        return parent::compile();
    }
public function compile ( ) { if ( $ this -> isCompiled ( ) ) { return $ this -> _compiled ; } $ g11n = G11n :: registry ( ) ; if ( $ g11n -> isEnabled ( ) ) { if ( mb_substr ( $ this -> getPath ( ) , 0 , 9 ) !== '/<locale>' ) { $ this -> prepend ( '/<locale>' ) ; } $ this -> setConfig ( 'patterns.locale' , self :: LOCALE ) ; $ this -> setConfig ( 'locale' , G11n :: canonicalize ( $ g11n -> getFallback ( ) -> getCode ( ) ) ) ; } return parent :: compile ( ) ; }
Prepend the locale to the front of the route before compilation.

@return string
Prepend the locale to the front of the route before compilation .