How do I add "translation strings" to the words "Are you sure?"
Like this __('Are you sure?')
I tried adding __ but it got an error.
{{ Form::open(array('route' => array(
'admin.users.change_status', $user->id),
'method' => 'patch',
'onsubmit' => 'return confirm("Are you sure?")'
)) }}
CodePudding user response:
You would have to escape the string you're making, because clientside is not aware of serverside localisation methods.
{{ Form::open(array('route' => array(
'admin.users.change_status', $user->id),
'method' => 'patch',
'onsubmit' => 'return confirm("' . __('Are you sure?') .'")'
)) }}