Skip to content

Commit 0f86d96

Browse files
committed
브라우저 언어값으로 자동 이동되는 문제 수정
1 parent 6880a5c commit 0f86d96

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Http/Middleware/DetectLanguage.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function handle(Request $request, Closure $next)
4848
$browserLocale = $this->browserDetectedLanguage();
4949
$cookieLocale = $this->cookieDetectedLanguage();
5050

51+
// URL로 지정된 언어가 기본 언어가 아닌 경우
5152
if (!$this->isDefaultLocale($pathLocale)) {
5253
$this->handler->store($pathLocale);
5354
$this->setLocale($pathLocale);
@@ -61,11 +62,6 @@ public function handle(Request $request, Closure $next)
6162
return redirect()->to(Route::localizedUrl($cookieLocale));
6263
}
6364

64-
// 브라우저로 자동 디텍트
65-
if ($pathLocale !== $browserLocale) {
66-
return redirect()->to(Route::localizedUrl($browserLocale));
67-
}
68-
6965
// 기본 값
7066
$this->handler->store($pathLocale);
7167
$this->setLocale($pathLocale);

0 commit comments

Comments
 (0)