簡體   English   中英

Laravel 8 認證郵件翻譯

[英]Laravel 8 authentication email translations

我是 Laravel 的新手,我創建了一個 Laravel 8 / Breeze 應用程序,現在我正在嘗試翻譯身份驗證電子郵件。 我不想自定義這些電子郵件,只需翻譯文本即可。 看看下面的代碼讓我覺得有一個 get() 方法可以從文件中讀取翻譯。 但我不知道這個文件在哪里讀取,以及它(或應該)存儲在哪里。 我什至不知道讀取文件 ore 定義它的位置的代碼在哪里,或者我應該把它放在哪里。 此代碼位於 vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php 中:

    /**
 * Get the reset password notification mail message for the given URL.
 *
 * @param  string  $url
 * @return \Illuminate\Notifications\Messages\MailMessage
 */
protected function buildMailMessage($url)
{
    return (new MailMessage)
        ->subject(Lang::get('Reset Password Notification'))
        ->line(Lang::get('You are receiving this email because we received a password reset request for your account.'))
        ->action(Lang::get('Reset Password'), $url)
        ->line(Lang::get('This password reset link will expire in :count minutes.', ['count' => config('auth.passwords.'.config('auth.defaults.passwords').'.expire')]))
        ->line(Lang::get('If you did not request a password reset, no further action is required.'));
}

翻譯應在resources/lang/{locale}中找到,其中 locale 是目標語言要了解更多信息,請閱讀文檔https://laravel.com/docs/8.x/localization

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM