laravellocalizationtranslation

Laravel translation not working


I have languages for french and english. Fallback and standard is french (fr).

My folder structure: enter image description here

This is the content of the login.php (english):

<?php
return [
    'welcome' => 'Welcome',
    'mail' => 'E-Mail address',
    'password' => 'Password'
];

I am referencing the keys either using @lang() or {{ trans('') }}. Example:

<label for="email" class="col-md-4 control-label">{{ trans('admin.login.mail') }}</label>

However this gets returned as: enter image description here


Solution

  • When you're putting language files into subfolder, you need to specify it using slash. So, try this instead:

    {{ trans('admin/login.mail') }}