Use Laravel Localization feature into my Laravel/Vue.js Inertia App
Hello Folks, I'm new to Laravel/Vue.js. I'm trying to implement the Localization feature on my Laravel 9 app where I'm using Vue.js with Inertia. I have followed the Localization documentation but the thing is I'm unable to print the translation keys on the front end. If someone has already implemented such functionality or shared the resource (tutorial or blog) to implement a similar functionality I will be really thankful. Should I go for any additional vue/Laravel package i.e. i189 etc?
I would recommend to implement some backend routes so that the user can set his own locale. For example a route like
Route::post('/locale', [LanguageController::class, 'store'];
The controller could store this information in the user's session. Now for each Controller that is returning the translations to your frontend pages the controller would first check the user's language setting in their session and only return the translation for that language.