/** * {@inheritDoc} * * The normal phpcr-odm locale listener "waits" until the routing completes * as the locale is usually defined inside the route. We need to set it * already in case the route document itself is translated. * * For example the CmfSimpleCmsBundle Page documents. */ protected function determineLocale($url) { $locale = parent::determineLocale($url); if ($locale && $this->doctrine) { $this->getDocumentManager()->getLocaleChooserStrategy()->setLocale($locale); } return $locale; }