Juliatzin
Juliatzin

Reputation: 19695

translation not interpreted in Laravel 5

In laravel 5, when I write this in my view:

@include("places.form", ["submitButton" => @lang('crud.updateModel', ['currentModelName' => $currentModelName])])

I get this:

@lang('crud.addModel', ['currentModelName' => Lugar])

How can I do so that it can be interpreted?

Upvotes: 0

Views: 52

Answers (2)

manix
manix

Reputation: 14747

Try:

@include("tournaments.form", ["submitButton" => trans('crud.addTournament')])

You will get:

["submitButton" => 'the translated text']

Upvotes: 1

Mohamed Mo Kawsara
Mohamed Mo Kawsara

Reputation: 4688

{{ }} and {!! !!} are just a wrapper around <?php echo ?> therefore in all Blade directives you don't have to add it use type as if you are typing in PHP file! use you translation function without curly brackets, and you don't need the double quotations too:

@include("tournaments.form", ["submitButton" => trans('crud.addTournament') ])

Upvotes: 0

Related Questions