Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin not recognizing localized routes #2247

Closed
tjveldhuizen opened this issue Nov 23, 2023 · 3 comments
Closed

Plugin not recognizing localized routes #2247

tjveldhuizen opened this issue Nov 23, 2023 · 3 comments

Comments

@tjveldhuizen
Copy link

The plugin seems to have problems handling localized routes. In this example, the route name in all three of the generated URL's is valid (and working in my application), but only links to a specific locale are found by the plugin.

image

@damienalexandre
Copy link

I can confirm this issue.

image

I suspect this is due to the way Symfony is storing those routes inside /var/cache/dev/url_generating_routes.php:

[ // ...
    'profile_plan.en' => [[], [
        '_controller' => 'App\\Controller\\ProfileController::plan', 
        '_locale' => 'en', 
        '_canonical_route' => 'profile_plan'
    ], [], [['text', '/account/plan']], [], [], []],
    'profile_plan.fr' => [[], [
        '_controller' => 'App\\Controller\\ProfileController::plan', 
        '_locale' => 'fr', 
        '_canonical_route' => 'profile_plan'
    ], [], [['text', '/fr/account/plan']], [], [], []],

I think the plugin should look at the _canonical_route option. When it's set, it means this route is a translation of a base route.

@damienalexandre
Copy link

damienalexandre commented Jan 16, 2024

It looks like a fix has been merged for this here: #2266

I just updated and it fix the issue for me! Thanks!

@tjveldhuizen
Copy link
Author

Indeed! Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants