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();
    }