سلام دوستان
من از لاراول استفاده می کنم و فارسی سازی کردم همه ی جا ها فارسی است ولی ایمیل فراموشی رمز عبور فارسی نیست از کجا می شود فارسی سازی کرد ؟
لطفا راهنمایی کنید
باتشکر
میتونید از این روشی که میگم استفاده کنید
قطعه کد زیر رو در مدل User قرار بدید
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
و با دستور artisan یک notification با عنوان ResetPasswordNotification ایجاد کنید .
داخلش میتونید خیلی راحت متن ایمیل رو مشخص و ارسال کنید یک نمونه ازش رو در زیر قرار میدم
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class ResetPasswordNotification extends Notification
{
/**
* The password reset token.
*
* @var string
*/
public $token;
/**
* Create a notification instance.
*
* @param string $token
* @return void
*/
public function __construct($token)
{
$this->token = $token;
}
/**
* Get the notification's channels.
*
* @param mixed $notifiable
* @return array|string
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Build the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('ریست کردن پسورد راکت')
->line('شما این ایمیل را دریافت کردید بخاطر اینکه از ما درخواست بازیابی گذرواژه برای حساب کاربری برای خود کرده اید .')
->action('ریست پسورد', url(config('app.url').route('password.reset', $this->token, false)))
->line('اگر شما درخواست ریست پسورد نکردید پس لازم نیست هیچ اقدامی انجام بدید');
}
}سلام این مسیر فایل هست که میتونید به راحتی فارسی کنیدش .. اسم فایل هم ResetPassword
\vendor\laravel\framework\src\Illuminate\Auth\Notificationsشاید پاسخ شما همینجا باشد
من از کل شما استفاده کردم ولی تو اجرا خطای زیر نشون میده
"Expected response code 354 but got an empty response"
از فایل
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php
خطی که خطا میگیره
if (!$response) {
$this->throwException(new Swift_TransportException('Expected response code '.implode('/', $wanted).' but got an empty response'));
}برای فارسی کردن
{"Reset Password Notification" :"ایمیل بازیابی کلمه عبور",
"You are receiving this email because we received a password reset request for your account.":
"ما یک درخواست بازیابی کلمه عبور از طرف شما دریافت کرده ایم",
"This password reset link will expire in :count minutes."
:"این لینک بازنشانی پسورد بعد از :count دقیقه منقضی می گردد.",
"Please click the button below to verify your email address." :
"لطفا جهت تایید آدرس ایمیل تان بر روی دکمه زیر کلیک کنید",
"If you did not request a password reset, no further action is required.":
"اگر شما این درخواست را ارسال نکرده اید، نیاز به هیچ اقدامی نیست",
"Verify Email Address":"تایید آدرس ایمیل",
"If you did not create an account, no further action is required.":
"اگر این اکانت مربوط به شما نمی باشد. نیاز به هیچ اقدامی نیست",}