Skip to content

Commit

Permalink
Update RouteExtension.php
Browse files Browse the repository at this point in the history
  • Loading branch information
artgris authored Dec 12, 2023
1 parent 8b3bc33 commit 1c23bbc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Twig/RouteExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ public function transformeToRoute(?string $routeName): string
$defaults = $params->getDefaults();
$controller = $defaults['_controller'];
if ($routeName === $controller) {
return $params->getPath();
if ($locale) {
if ($locale == $params->getDefault('_locale')) {
return $params->getPath();
}
} else {
return $params->getPath();
}
}
}

Expand Down

0 comments on commit 1c23bbc

Please sign in to comment.