As your localization is done server-side, you will need a full reload.
But, you can tell inertia to do a full reload for you, instead of asking the users to perform a manual reload.
Just return an Inertia's external response, to the previous page, and inertia will make a full reload for you:
public function store(StoreLocalRequest $storeLocalRequest, string $locale)
{
try {
app()->setLocale($locale);
session()->put('locale', $locale);
Inertia::share('locale', $locale);
} catch (Exception $e) {
Log::error($e);
dd($e);
return redirect()->back()->with('alert', [
'type' => 'error',
'code' => trans('app.admin.locale.error-update')
]);
}
$response = redirect()->back()->with('alert', [
'type' => 'error',
'code' => trans('app.admin.locale.error-update')
]);
// Inertia is smart enough to identify
// the redirect URL from the response object
return Inertia::location($response);
}