-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Routing] i18n routing. #9515
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
[Routing] i18n routing. #9515
Conversation
I've chosen to use the PHP configurator DSL as the example. I hadn't seen it used previously in the examples. This might be something we'll need to look into in a broader sense. |
Status: Needs work |
@javiereguiluz the docs for the docs say the PRs get automatically built by platform.sh? Are they published somewhere too? |
If this one is merged, should close #9510 |
routing.rst
Outdated
/** | ||
* Matches /blog exactly | ||
* | ||
* @Route("/blog", name="blog_list") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The annotation example look wrong to me. It should have the same routes as the YAML, XML, and PHP examples.
routing.rst
Outdated
@@ -611,6 +694,18 @@ But if you pass extra ones, they will be added to the URI as a query string:: | |||
)); | |||
// /blog/2?category=Symfony | |||
|
|||
Generating Localized URLs | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be stripped to match the length of the headline
routing.rst
Outdated
}; | ||
|
||
When a localized route is matched Symfony will automatically know which locale | ||
should be used during the request. Defining routes this way also eliminated the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"eliminates"?
routing.rst
Outdated
Generating Localized URLs | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
When you've defined localized routes Symfony will use the current request locale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[...] routes, Symfony [...]
routing.rst
Outdated
|
||
When you've defined localized routes Symfony will use the current request locale | ||
as the default when generating routes. In order to generate the route for alternative | ||
locale you must pass the ``_locale`` in the parameters array:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"for alternative locales" or "for an alternative locale"
This paragraph should be removed with this new documentation: http://symfony.com/doc/master/routing.html#translating-routes |
routing.rst
Outdated
->controller('App\Controller\CompanyController::about'); | ||
}; | ||
|
||
When a localized route is matched Symfony will automatically know which locale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a localized route is matched, Symfony will automatically know, which ...
and perhaps matches
instead of is matched
?
Frank, thanks for contributing these docs. Thank you also for implementing this fantastic feature! The community loves it and it's definitely one of the best new features of Symfony 4.1. By the way, congrats on your first Symfony Docs contribution too! |
This PR was merged into the 4.1 branch. Discussion ---------- Removed an outdated section After merging #9515 we forgot to remove this deprecated section, as pointed by @michaelperrin in this comment: #9515 (comment) Commits ------- 00ec943 Removed an outdated section
@javiereguiluz thank you! 👍 |
No description provided.