Closed jeffsmor closed 1 year ago
Hello,
Did you call Route::localizedUrl('en')
on a localized route?
If you call it on a localized route, then it should work.
However, if you call it on a route that is registered outside the Route::localized()
closure, then it returns the same URL.
This is because there are no localized versions of that route.
I did forget to include a test for that, so I'll add it.
Hello,
Did you call
Route::localizedUrl('en')
on a localized route?If you call it on a localized route, then it should work.
However, if you call it on a route that is registered outside the
Route::localized()
closure, then it returns the same URL. This is because there are no localized versions of that route.I did forget to include a test for that, so I'll add it.
Yes.
This is my routes/web.php
Route::localized(function () {
Route::get('/', function (Request $request) {
return view('home');
})->name('home');
});
And I'm calling the Route::localizedUrl('en')
inside the view home.
According to my test this should work. I also copied your setup to a fresh Laravel project and put it on GitHub. https://github.com/ivanvermeyen/domain-test
If you open the homepage at domain-test.test (the domains I configured) you should see 3 URL's:
I've added you to the project, so if you can replicate the issue I can try to fix it 👍
EDIT: Make sure your domains actually work. If they don't match the configured domains, you will get 3 times the same output.
Hi man,,,
I got your project and it is really functional...
I came back to my one and I found out the issue.
I set:
'fallback_locale' => 'en',
When it is null
I have what I am expecting.
However, I am just at the beginning of my project and soon I plan how the localized routes will work.
Thanks for now.
That's definitely not working as intended :) I see it too now. Thanks for catching this, I will look into it.
Should be fixed in 2.9.1 👍
Hi...
I have the folowing supported locale array:
And the following home blade view:
When I get mysite.test I see:
Everything ok, when I change my supported locale array to:
And get mysite.test again I see:
Is it a package issue?
Amazing package, by the way...