Replies: 1 comment 1 reply
-
|
Hey, I looked into this issue and checked Wayfinder source code. The problem: Wayfinder generates static URLs at build time. When you use Current status: This is a known limitation. Theres an open issue for this: laravel/wayfinder#116 and you also opened laravel/wayfinder#134 Possible workaround: Wayfinder has So instead of: Route::group([
'prefix' => LaravelLocalization::setLocale(),
// ...
], function () {
Route::get('faq', [FaqController::class, 'index']);
});You would need something like: Route::group([
'prefix' => '{locale}',
// ...
], function () {
Route::get('faq', [FaqController::class, 'index']);
});Then in your Vue app entry point: import { setUrlDefaults } from 'wayfinder';
// Get current locale from page props or meta tag
const locale = document.documentElement.lang || 'en';
setUrlDefaults({ locale });But honestly: If you need proper i18n routing with mcamara/laravel-localization, Ziggy is still the better option right now. Wayfinder team is aware of this limitation but havent implemented full i18n support yet. Hope this helps clarify the situation! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi so i have a laravel project with multiple languages. I use wayfinder in vue for my routes but when i look in my browser i see that when hovering a link i see an url that has no locale in the url.

In my route file we configure the locale prefix like following:
In my Vue i do this (code is trimmed)
Am i doing something wrong in the route file or is it not yet supported in wayfinder because it worked fine with ziggy
Beta Was this translation helpful? Give feedback.
All reactions