views/emails
en/
welcome.blade.php
ru/
welcome.blade.php
ar/
welcome.blade.phptrait TranslatableMail
{
protected function localizedView($name, $locale = null): string
{
$localizedView = 'emails.'.($locale ?? $this->user->language).'.'.$name;
return View::exists($localizedView) ? $localizedView : 'mails.en.'.$name;
}
}class WelcomeMail extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
use TranslatableMail;
public function build(): WelcomeMail {
return $this->from(config('mail.from.address'), config('mail.from.name'))
->subject(__('mail.subject.welcome', [], $this->user->language))
->view($this->localizedView('welcome'));
}
}views/emails/welcome.blade.php
lang/
ru/
mails.php
ar/
mails.php
Dear {{ $user->salutation }} {{ $user->fullname }};
Welcome to Platform.
Your Email Verification Code No. {{ $no }} is: {{ $code }}
Sincere Regards;Уважаемый (ая) {{ $user->salutation }} {{ $user->fullname }};
Добро пожаловать на платформу.
Ваш код подтверждения для электронной почты № {{ $no }}: {{ $code }}
С уважением,
@component('mail::message')
много текста
@endcomponent
__('Photographer Services') VS __('order.photografer')
{
"Dear :salutation :username;" : "Dear :salutation :username;"
"Welcome to Platform." : "Welcome to Platform."
"Your Email Verification Code No. :no is: :code" : "Your Email Verification Code No.
:no is: :code"
"Sincere Regards;" : "Sincere Regards;"
}Dear {{ $user->salutation }} {{ $user->fullname }};
Welcome to Platform.
Your Email Verification Code No. {{ $no }} is: {{ $code }}
Sincere Regards;Куча отдельных компонентов, условия, красивые кнопочки.. И ни единой попытки продублировать эти кнопочки на 100 языков. Смекаете?

<x-mail.message>
## Dear {{ __($user->salutation, [], 'en') }} {{ $user->fullname }};
Please note your trip with Order number <b>{{ $orderNo }}</b> that you placed was
successfully completed and processed on Platform.
You are receiving attached to this email the Service Level Agreement along with all the details of your trip to
Russia.
Your payment of <b>{{ $payment->amount_value }}</b> Rubles was successfully processed and received.
The tickets of the flights related to your travel and trip to Russia are processed separately and will be sent
directly to your registered email.
Thank you for your business and trust.
We wish you a pleasant and unforgettable journey.
Our Customer Support Desk is available 24/7, please do not hesitate to call us for any additional enquiry or
clarification.
<img src="{{ $message->embed(public_path('images/common/logo_en_100.png')) }}" alt="" border="0">
<br><b>Platform Reservation.</b>
</x-mail.message>
return [
'message' => 'Please note your trip with Order number <b>:order</b> that you placed was
successfully completed and processed on Platform.
You are receiving attached to this email the Service Level Agreement along with all the details of your trip to
Russia.
Your payment of <b>:amount</b> Rubles was successfully processed and received.
Very big text with html.'
];