protected function updateLocale(Route $doc, $id)
 {
     $matches = array();
     // only update route objects and only if the prefix can match, to allow
     // for more than one listener and more than one route root
     if (!preg_match('#' . $this->idPrefix . '/([^/]+)(/|$)#', $id, $matches)) {
         return;
     }
     if (in_array($matches[1], $this->locales) && !$doc->getDefault('_locale') && !$doc->getRequirement('_locale')) {
         $doc->setDefault('_locale', $matches[1]);
         $doc->setRequirement('_locale', $matches[1]);
     }
 }