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

Commitc15df9d

Browse files
author
Thomas Calvet
committed
[Routing] Add locale fallback to internationalized routes
1 parent96d3023 commitc15df9d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎routing.rst‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,17 @@ should be used during the request. Defining routes this way also eliminated the
210210
need for duplicate registration of routes which minimizes the risk for any bugs
211211
caused by definition inconsistency.
212212

213+
..tip::
214+
215+
If you use full locales (language + territory) in your application (e.g. `fr_FR`),
216+
you can use the language part only in your routes configurations (e.g. `fr`).
217+
218+
It also prevents you from repeating yourself when you want to use the same route path
219+
for several full locales that share the same language (e.g. `fr_FR` and `fr_BE`).
220+
221+
..versionadded::4.2
222+
The feature to fall back on the language part only was introduced in Symfony 4.2.
223+
213224
A common requirement for internationalized applications is to prefix all routes
214225
with a locale. This can be done by defining a different prefix for each locale
215226
(and setting an empty prefix for your default locale if you prefer it):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp