Skip to content

Commit 645819d

Browse files
fix bug in switching arabic to another language (#722)
to handle the case of switching from arabic to another lang Co-authored-by: DJEMMAL-nour-el-islam <52753848+djemml-nour-el-islam@users.noreply.github.com>
1 parent e511c76 commit 645819d

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
@@ -761,7 +761,7 @@ protected function findTranslatedRouteByUrl($url, $attributes, $locale)
761761
$routeName = $this->getURLFromRouteNameTranslated($locale, $translatedRoute, $attributes);
762762

763763
// We can ignore extra url parts and compare only their url_path (ignore arguments that are not attributes)
764-
if (parse_url($this->getNonLocalizedURL($routeName), PHP_URL_PATH) == parse_url($this->getNonLocalizedURL($url), PHP_URL_PATH)) {
764+
if (parse_url($this->getNonLocalizedURL($routeName), PHP_URL_PATH) == parse_url($this->getNonLocalizedURL(urldecode($url)), PHP_URL_PATH)) {
765765
$this->cachedTranslatedRoutesByUrl[$locale][$url] = $translatedRoute;
766766

767767
return $translatedRoute;

0 commit comments

Comments
 (0)