Laravel 8:如何翻译两因素身份验证默认消息

问题描述

我正在使用 Laravel Fortify,我想翻译这条认消息怎么办?

提供的两步验证码无效。

在这个地址找到了这条消息,但这是来源,我无法更改

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]);
}

解决方法

您安装和开发本地化了吗?似乎该消息只需要语言环境。应用语言的东西