src/Extension/FluentDirectorExtension.php
protected function getExplicitRoutes($originalRules)
    {
        $queryParam = static::config()->get('query_param');
        $rules = [];
        /** @var Locale $localeObj */
        foreach (Locale::getCached() as $localeObj) {
            $locale = $localeObj->getLocale();
            $url = $localeObj->getURLSegment();

            // apply encode so we could route urls that contain multi-byte charaters
            $url = urlencode($url);

            // Apply to nested page url
            $controller = $this->getRuleController($originalRules['$URLSegment//$Action/$ID/$OtherID'], $localeObj);
            $rules[$url . '/$URLSegment!//$Action/$ID/$OtherID'] = [
                'Controller' => $controller,
                $queryParam => $locale,
            ];

            // Home url for that locale
            $controller = $this->getRuleController($originalRules[''], $localeObj);
            $rules[$url] = [
                'Controller' => $controller,
                $queryParam => $locale,
            ];
        }
        return $rules;
    }
protected function getExplicitRoutes($originalRules)
    {
        $queryParam = static::config()->get('query_param');
        $rules = [];
        /** @var Locale $localeObj */
        foreach (Locale::getCached() as $localeObj) {
            $locale = $localeObj->getLocale();
            $url = $localeObj->getURLSegment();

            // apply encode so we could route urls that contain multi-byte charaters
            $url = urlencode($url);

            // Apply to nested page url
            $controller = $this->getRuleController($originalRules['$URLSegment//$Action/$ID/$OtherID'], $localeObj);
            $rules[$url . '/$URLSegment!//$Action/$ID/$OtherID'] = [
                'Controller' => $controller,
                $queryParam => $locale,
            ];

            // Home url for that locale
            $controller = $this->getRuleController($originalRules[''], $localeObj);
            $rules[$url] = [
                'Controller' => $controller,
                $queryParam => $locale,
            ];
        }
        return $rules;
    }
protected function getExplicitRoutes ( $ originalRules ) { $ queryParam = static :: config ( ) -> get ( 'query_param' ) ; $ rules = [ ] ; /** @var Locale $localeObj */ foreach ( Locale :: getCached ( ) as $ localeObj ) { $ locale = $ localeObj -> getLocale ( ) ; $ url = $ localeObj -> getURLSegment ( ) ; // apply encode so we could route urls that contain multi-byte charaters $ url = urlencode ( $ url ) ; // Apply to nested page url $ controller = $ this -> getRuleController ( $ originalRules [ '$URLSegment//$Action/$ID/$OtherID' ] , $ localeObj ) ; $ rules [ $ url . '/$URLSegment!//$Action/$ID/$OtherID' ] = [ 'Controller' => $ controller , $ queryParam => $ locale , ] ; // Home url for that locale $ controller = $ this -> getRuleController ( $ originalRules [ '' ] , $ localeObj ) ; $ rules [ $ url ] = [ 'Controller' => $ controller , $ queryParam => $ locale , ] ; } return $ rules ; }
Generate an array of explicit routing rules for each locale

@param array $originalRules
@return array
Generate an array of explicit routing rules for each locale