Open covaberjon opened 5 years ago
Same problem caused by "LaravelLocalization::setLocale()" in ->prefix(LaravelLocalization::setLocale())
Any updates here ?
Any updates?
Sorry but Laravel Nova is not open source, so I can't look into it to help you. You may need to fix it by yourself and send a PR. Or switch to an open source admin panel: https://voyager.devdojo.com/
Maybe I don't understand but can't you just create a 'frontend' middlewaregroup and reference that wherever you need route localization? That's what I do. Using a seperate group for frontend does not affect any Nova routes.
I have solved this issue for me. I have created a helper function for routing with using LaravelLocalization
class. Try this in web.php
instead of transRoute
method. Add the nova paths in config file btw.
function __route($name)
{
$shouldIgnore = function ($request) {
$excepts = config('laravellocalization.urlsIgnored', []);
foreach ($excepts as $except) {
if ($except !== '/') {
$except = trim($except, '/');
}
if ($request->is($except)) {
return true;
}
}
return false;
};
if ($shouldIgnore(request())) {
return;
}
return LaravelLocalization::transRoute('routes.' . $name);
}
@ysfkaya no luck man :(.
First of all, thank you for the package.
I have a problem using your package with Laravel Nova. I am only using your package with my frontend routes. However, my laravel nova backend is being affected.
Instead of showing my ES translations, is showing EN translations.
I tried adding:
'urlsIgnored' => ['/nova/*']
But it didn't work.
The only thing that actually worked was setting useAcceptLanguageHeader to false.