Skip to content

Commit 68a06bc

Browse files
iflamedMarc Cámara
authored and
Marc Cámara
committed
Fix #468 and #429 (#529)
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
1 parent 4f163fe commit 68a06bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Mcamara/LaravelLocalization/LaravelLocalization.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public function getCurrentLocale()
485485
return $this->currentLocale;
486486
}
487487

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

491491
return $negotiator->negotiateLanguage();

0 commit comments

Comments
 (0)