You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Note:** in a most practical scenario you would register a route either localized **or** non-localized, but not both. If you do, you will always need to specify a locale to get the URL, because non-localized routes always have priority when using the `route()` function.
107
117
108
-
## Redirect to Routes
118
+
###Redirect to Routes
109
119
110
120
Laravel's `Redirector` uses the same `UrlGenerator` as the `route()` function behind the scenes. Because we are overriding this class, you can easily redirect to your routes.
111
121
@@ -120,17 +130,17 @@ You can't redirect to URL's in a specific locale this way, but if you need to, y
120
130
return redirect(route('about', [], true, 'nl')); // redirects to /nl/about
121
131
```
122
132
123
-
## Translate Routes
133
+
###Translate Routes
124
134
125
135
If you want to translate the segments of your URI's, create a `routes.php` language file for each locale you [configured](#configure-supported-locales):
126
136
127
137
```
128
-
resources/
129
-
|-lang/
130
-
|-en/
131
-
| |-routes.php
132
-
|-nl/
133
-
|-routes.php
138
+
resources
139
+
└── lang
140
+
├── en
141
+
│ └── routes.php
142
+
└── nl
143
+
└── routes.php
134
144
```
135
145
136
146
In these files, add a translation for each segment.
0 commit comments