Translate in a specific language in Laravel
'Making a business presentation in front of an audience',要有自信 #生活技巧# #职场沟通技巧# #商务英语#
I have a multilanguage website in Laravel 4.2, and would like to send an email notification to the admins in a specified language using the lang files.
How can I call Lang::get('group.key') specifying the needed language ?
Thank you for your help !
Edit: existing code: (the lang items are option1, option2, .., option6)
class EmailController extends BaseController { public static function contact(){ $rules = [ 'name' => 'required', 'email' => 'required|email', 'subject' => 'required|digits_between:1,6', 'message' => 'required' ]; $validator = Validator::make(Input::all(), $rules); if (!$validator->fails()){ $data = ['subject' => Input::get('subject'), 'email' => Input::get('email'), 'content' => Input::get('message')]; Mail::send('emails.contact', $data, function($message){ $message->from(Input::get('email'), Input::get('name')); $message->to('admin@email.com', 'Admin'); $message->subject(Lang::get('contact.option'.Input::get('subject'))); }); } return Redirect::to('/'); } }
网址:Translate in a specific language in Laravel https://www.yuejiaxmz.com/news/view/1323221
相关内容
How To Get Help In Windows 11 (All Methods)The Power of a Calm Mind: Life Wisdom in Zen Buddhism
Understand the recurrent neural network RNN in one article (2 optimization algorithms + 5 practical applications)
Server Error in '/' Application.
Server Error in '/' Application.
Server Error in '/trade3' Application.
What Time is Sunrise and Sunset in London, United Kingdom?
UNDERSTANDING THE LIFESTYLE IN CHINESE CITIES: A FRAMEWORK BASED ON SPACE
in everyday way
Research progress in the relationship between gut microbiota and food allergy in children