diff --git a/Router/I18nRouter.php b/Router/I18nRouter.php index 2247615..94266c6 100644 --- a/Router/I18nRouter.php +++ b/Router/I18nRouter.php @@ -201,6 +201,12 @@ private function matchI18n(array $params, $url) $params['_route'] = substr($params['_route'], $pos + strlen(I18nLoader::ROUTING_PREFIX)); } + foreach($this->hostMap as $locale => $host) { + if ($host == $this->context->getHost()) { + $this->context->setParameter('_locale', $locale); + } + } + if (!($currentLocale = $this->context->getParameter('_locale')) && $this->container->isScopeActive('request')) { $currentLocale = $this->localeResolver->resolveLocale(