File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 2525***/
2626
2727use CodeIgniter \Config \BaseConfig ;
28+ use CodeIgniter \Config \Config ;
2829use CodeIgniter \Config \Services ;
2930use CodeIgniter \Router \RouteCollectionInterface ;
3031use Tatter \Assets \Exceptions \AssetsException ;
@@ -276,7 +277,17 @@ protected function sanitizeRoute()
276277 // Clean up slashes
277278 $ this ->route = trim ($ this ->route , '/ ' );
278279
280+ // Verify for {locale}
281+ if (Config::get ('App ' )->negotiateLocale ) {
282+ $ route = explode ('/ ' , $ this ->route );
283+ if (count ($ route ) && $ route [0 ] == Services::request ()->getLocale ()) {
284+ unset($ route [0 ]);
285+ }
286+ $ this ->route = implode ('/ ' ,$ route );
287+ }
288+
279289 // If the route is empty then assume the default controller
290+
280291 if (empty ($ this ->route ))
281292 {
282293 $ this ->route = strtolower ($ this ->collection ->getDefaultController ());
You can’t perform that action at this time.
0 commit comments