Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Routing] Add locale requirement for localized routes#35735

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@mtarld
Copy link
Contributor

@mtarldmtarld commentedFeb 15, 2020
edited by nicolas-grekas
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
LicenseMIT

4.4 version of#35692

If you're using localized routes, you expect to have these kind of routes available:

  • /fr/accueil
  • /en/home

But nowadays, these routes are unexpectedly available:

  • /en/accueil
  • /fr/home

When importing routes like that:

  • prefix: "/{_locale}"
  • @Route({"en": "/home", "fr": "/accueil"}, name="home")

This PR proposes to add a strict locale requirement for localized so that the above routes won't be available.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM.
For the future, we could have a smart RouteCompiler that knows how to turn static requirements into actual static routes.
But that's for another PR :)

mtarld and HeahDude reacted with thumbs up emoji
@fabpot
Copy link
Member

Thank you@mtarld.

mtarld reacted with thumbs up emoji

@fabpotfabpot merged commit88b89c9 intosymfony:4.4Feb 20, 2020
@mtarldmtarld deleted the fix/localized-routes-requirements-4.4 branchFebruary 20, 2020 08:15
nicolas-grekas added a commit that referenced this pull requestFeb 25, 2020
This PR was merged into the 4.4 branch.Discussion----------[Routing] Improve localized routes performances| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | no| License       | MITImplementation of the following idea:#35735 (review)Improve route matching performances by turning dynamic routes with fixed `_locale` to actual static routes.Commits-------8e9eafe [Routing] Improve localized routes performances
This was referencedFeb 29, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

5 participants

@mtarld@fabpot@nicolas-grekas@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp