2

I have a view which call the bootbox plugin to display a modal, the message of this modal is the following:

'confirm_invite'    => 'The :user has invited you, do you want accept?',

This is my view:

@extends('boilerplate::layout.index', [
'title' => __('boilerplate::layout.dashboard'),
'subtitle' => 'Components & plugins demo',
'breadcrumb' => ['Components & plugins demo']]
)

@section('content')

    @isset($invite)
        @push('js')
            <script>
                bootbox.confirm({
                    title: `{{ __('invites.invite_received', ['user' => $invite->user->first_name]) }}`,
                    message: `{{ __('invites.confirm_invite') }}`,
                    callback: function(result) {
                        if (result) {
                            alert('hello there');
                        }
                    }
                })
            </script>
        @endpush
    @endisset

    @include('boilerplate::plugins.demo')
@endsection

The modal appears correctly but the :user field isn't replaced by the variable, I can still see The :user has invited you, do you want accept?

1
  • What have you tried to resolve the problem? Where are you stuck? Commented Feb 1, 2022 at 14:51

1 Answer 1

1

I think you forgot to pass the user as a second argument to the __ function.

Try changing

__('invites.confirm_invite')

to

__('invites.confirm_invite', ['user' => $invite->user->first_name])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.