1

When using localization in controllers, the symfony "Redirecting to $page" is visible for 2-3 seconds. When I remove localization from the controller, the problem goes away.

So, this shows me the "Redirecting to $page" page for a second or two,

public function processPassword(Authenticatable $user, Request $request)
{
    [..] 
    $message = trans("translation.password_changed");

    return redirect()->route('edit-password')->with('alert', ['type' => 'success', 'message' => $message]);

}

and this does not

public function processPassword(Authenticatable $user, Request $request)
{
    [..] 
    $message = "Your password has been changed";

    return redirect()->route('edit-password')->with('alert', ['type' => 'success', 'message' => $message]);
}

How is this possible and how do I add localization to my controllers?

Stephan Vierkant
  • 9,674
  • 8
  • 61
  • 97
Tristel
  • 70
  • 4

0 Answers0