How to use localization in Blade tag templates?

laravel, laravel-4, laravel-blade

Solution

Supposing that your messages are stored in `app/lang/en/message.php` you can use the same way for all your cases:

In Blade template:

{{ Form::label('name', Lang::get('message.key')) }}

{{ Form::text('name', null, array('placeholder' => Lang::get('message.key'))) }}

{{ Form::submit(Lang::get('message.key'), array('class' => 'btn btn-success')) }}

In HTML tag mixed with some Blade expression:

<a href="{{ URL::to(Lang::get('message.key')) }}">BLAH</a>

Problem

1st question: I've inserted the localization in many types of texts and things, but I don't know how to import it into in the following forms: ``` {{ Form::label('name', 'here') }} {{ Form::text('name', null, array('placeholder' => 'here')) }} {{ Form::submit('here', array('class' => 'btn btn-success')) }} {{ Form::button('here', array('class' => 'btn btn-default')) }} ``` I want it to be in the form label 'here' and in the placeholder of the text 'here'. 2nd question: I am not allowed to insert it with links in my language file: `text here blah blah <a href="{{ URL::to('text') }}">BLAH</a>?` Is there anyway to insert it with links? Thanks in advance.

Original source