FilamentF
Filamentβ€’2y ago
Soundmit

Please help with frontend translation

I've decided to quit my 17 years job as developer because i can't find a way to translate a laravel frontend πŸ™‚

Joke aside,
I'm able (80%) to set the language in the session with a language switcher
but i can't redirect to the translated page...

i use spatie/translatable and i have a page with
en slug: test-en
it slug: test-it

When in the english page i try to translate in italian
but the slug doesn't change

the language switcher
@foreach (config('app.supported_locales') as $locale => $language)
    <a href="{{ route('locale', ['locale' => $locale, 'slug' => request()->path()]) }}">
        {{ $language['name'] }}&nbsp;
    </a>
@endforeach

the link produced
https://test.ddev.site/language/en/test-en
https://test.ddev.site/language/it/test-en

i think that the links need to be
https://test.ddev.site/test-en
https://test.ddev.site/test-it
Was this page helpful?