protected function localizeCollectionLocaleParameter($prefix, RouteCollection $collection)
    {
        $localizedPrefixes = array();
        foreach ($collection->all() as $name => $route) {
            $locale = $route->getDefault(self::LOCALE_PARAM);
            if ($locale === null) {
                // No locale so nothing to do
                $routePrefix = $prefix;
            } else {
                // A locale was found so localize the prefix
                if (!isset($localizedPrefixes[$locale])) {
                    $localizedPrefixes[$locale] = preg_replace(static::LOCALE_REGEX, $locale, $prefix);
                }
                $routePrefix = $localizedPrefixes[$locale];
            }
            $route->setPath('/' . $routePrefix . $route->getPath());
        }
    }