Skip to content

Commit

Permalink
Fix #468 and #429 (#529)
Browse files Browse the repository at this point in the history
When app is running in the console, we should use the default value of config('app.locale'), don't need to negotiator with the accept-language
  • Loading branch information
iflamed authored and Marc Cámara committed Mar 15, 2018
1 parent 4f163fe commit 68a06bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Mcamara/LaravelLocalization/LaravelLocalization.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public function getCurrentLocale()
return $this->currentLocale;
}

if ($this->useAcceptLanguageHeader()) {
if ($this->useAcceptLanguageHeader() && !$this->app->runningInConsole()) {
$negotiator = new LanguageNegotiator($this->defaultLocale, $this->getSupportedLocales(), $this->request);

return $negotiator->negotiateLanguage();
Expand Down

0 comments on commit 68a06bc

Please sign in to comment.