title: Laravel 5.8 Validation Localization - not translating error messages
body: <p>I have a problem that should be relatively simple, but I've read through the documentation and multiple posts here and I still can't figure it out. :( </p>
  
  <p>I am creating a Laravel application with localisation (EN &amp; FR). Everything works fine on the page in terms of localisation. However, when it comes to validation, I cannot seem to get the errors to translate. </p>
  
  <p>Here is some sample code:</p>
  
  <p><em>Note that I have removed mostly irrelevant code to make this example cleaner.</em></p>
  
  <h1>Validator within Controller</h1>
  
  <pre><code> $validator = Validator::make($request-&gt;all(), [
        'email' =&gt; 'required|email|max:120',
   ]);
  </code></pre>
  
  <h1>Blade</h1>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;label for="input-email"&gt;@error('email') {{ $errors-&gt;first('email') }} @else @lang('index.email') @enderror&lt;/label&gt;
      &lt;input type="email" name="email" placeholder="@lang('index.email')" value="{{ old('email') }}"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <h1>Validation Structure</h1>
  
  <p>resources/lang</p>
  
  <p>&nbsp;&nbsp;&nbsp;&nbsp; en</p>
  
  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validation.php</p>
  
  <p>&nbsp;&nbsp;&nbsp;&nbsp; fr</p>
  
  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validation.php</p>
  
  <h1>fr/validation.php</h1>
  
  <pre><code>&lt;?php
  
  return [
      'email' =&gt; 'Veuillez insérer une adresse email valide.',
  ];
  </code></pre>
  
  <h1>en/validation.php</h1>
  
  <p>
  
  <pre><code>php
  
  return [
      'email' =&gt; 'Please insert a valid email address.',
  ];
  </code></pre>
  
  <p>I have tried:
  - to clean the cache: </p>
  
  <pre><code>php artisan cache:clear
  </code></pre>
  
  <p>One thing that I have noticed is that it seems to always return with the validation in English. It seems to ignore the fr/validation.php file. </p>
  
  <p>Does anyone know why? Is there someway to force the locale within the validator? Or, am I missing something here? I greatly appreciate your comments, suggestions, and thoughts!</p>
  
  <p>Thanks @nakov for the suggestion. I am able to force the language withint he config/app.php file. </p>
  
  <pre><code>'locale' =&gt; 'fr',
  </code></pre>
  
  <p>Here, <strong>it will change the locale</strong> for the validation, which is awesome. Now, the question is, why is the "link" missing / broken within the controller? I.e., knowing that the applocale has been set to FR, why is it bringing back the EN version of validation.php? Can I force this within the controller?</p>
  
  <p>Here is how I have the Routing setup to set the locale:</p>
  
  <pre><code>Route::get('/{lang?}', function($lang = 'en') {
      App::setLocale($lang);
      return view('welcome');
  });
  </code></pre>
  
  <h2>#ANSWER</h2>
  
  <p>Thanks to @nakov for all of your help and suggestions!</p>
  
  <p>So, the problem was that the locale <em>does not persist</em> and therefore was being lost upon refresh when validation failed. </p>
  
  <p>How did I fix it?</p>
  
  <p>Within the controller:</p>
  
  <p>"use" the application</p>
  
  <pre><code>use Illuminate\Foundation\Application;
  </code></pre>
  
  <p>bring it into your function, in my case it is store:</p>
  
  <pre><code>public function store(Application $app, Request $request)
  </code></pre>
  
  <p>within Blade, set the locale within a hidden input. I named mine "language", but feel free to name it as you like. Then, again within the controller, set the locale to this language</p>
  
  <pre><code>$app-&gt;setLocale($request-&gt;language);
  </code></pre>
  
  <p>and bingo! Your problem is solved. :) Thanks again @nakov! </p>
  
  <p>Thanks!</p>
  
  <p>Brad</p>