Feralheart
Feralheart

Reputation: 1940

Laravel localization error

I tried to localise the "base theme" (what we get after the make:auth), but I got this error message:

Parse error: syntax error, unexpected ''failed'' (T_CONSTANT_ENCAPSED_STRING), expecting ']'

Only I changed the Login to @lang('auth.login') (I made a login string in the auth localisation file)

'login' => 'Login',

Code snippet from the template:

@if (Auth::guest())
    <li><a href="{{ route('login') }}"> @lang('auth.login') </a></li>
    <li><a href="{{ route('register') }}">Register</a></li>
@else
    <li class="dropdown">

What's wrong?

Upvotes: 0

Views: 156

Answers (1)

Garric
Garric

Reputation: 552

The error message tell you it expecting the end of the array, but there is another string instead. Each values must be separated by comma.

So put a , at the end of the previous line.

From this:

[
    'something' => 'Something'
    'failed' => 'Failed',
    ...
];

to this:

[
    'something' => 'Something',
    'failed' => 'Failed',
    ...
];

Upvotes: 1

Related Questions