L
L
lynnikvadim2015-07-13 19:10:52
Laravel
lynnikvadim, 2015-07-13 19:10:52

Language strings not working in laravel 5?

This is my controller :

<?php namespace App\Http\Controllers\admin;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\User;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Lang;

class UserController extends Controller {

  /**
   * Display a listing of the resource.
   *
   * @return Response
   */
  public function index()
  {
    App::setLocale('ru');
    $lang = Lang::get('messages.userlist');
    dd($lang);
    $user = User::all();
    return view ('admin.UserView', ['user'=>$user]);

  }
}

This is my language file named "messages" :
<?php
return [
 
    'userlist'   => 'Имя пользователя и пароль не совпадают.',
    
];

But at the output I get the following phrase "messages.userlist"
The path to the file resources/lang/ru/messages.php
What did I write wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-07-13
@alexey-m-ukolov

But at the output I get the following phrase "messages.userlist"

Do you have the language file in the resources/lang/ru folder ?
Neither in the file name, nor in the key, nor when calling, is the layout for the letter e mixed up , for example?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question