Inertia vue 3 localization
What is the best package out there for localization ?
I found this https://github.com/kg-bot/laravel-localization-to-vue and I am testing in my laravel 8 with inertia vue 3.
In inertia middleware (HandleInertiaRequests.php):
'lang' => [
'current_locale' => App::currentLocale(),
'default_locale' => config('app.locale'),
'fallback_locale' => config('app.fallback_locale'),
'messages' => ExportLocalization::export()->toArray(),
]
but that export is returning all the the stuff (auth, pagination, password, validation). and I don't want that.
I created a single php file frontend.php and I want to return only that content.
How can I do that ?
And another thing is I can't change the locale.
I set the route:
Route::get('/{locale}', function ($locale) {
if(! in_array($locale, ['en', 'ro'])) {
abort(400);
}
App::setLocale($locale);
return Inertia::render('Home');
});
and when enter to /ro the current locale
$locale = App::currentLocale();
is still english. What I am missing ?
Please or to participate in this conversation.