Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
674 views
in Technique[技术] by (71.8m points)

fortify - Laravel 8: how to translate two factor authentication default message

I'm usign Laravel Fortify and i want translate this default message how do it?

The provided two factor authentication code was invalid.

I found this message in this address but this is source and i can't change it

src/Http/Responses/FailedTwoFactorLoginResponse.php

public function toResponse($request)
{
    $message = __('The provided two factor authentication code was invalid.');

    if ($request->wantsJson()) {
        throw ValidationException::withMessages([
            'code' => [$message],
        ]);
    }

    return redirect()->route('login')->withErrors(['email' => $message]);
}
question from:https://stackoverflow.com/questions/65860557/laravel-8-how-to-translate-two-factor-authentication-default-message

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Did you install and develop Localization? Seems that message only need the locale. for apply the languages things


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...