Skip to content

Commit

Permalink
fix bug in switching arabic to another language (#722)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
1 parent e511c76 commit 645819d
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 @@ -761,7 +761,7 @@ protected function findTranslatedRouteByUrl($url, $attributes, $locale)
$routeName = $this->getURLFromRouteNameTranslated($locale, $translatedRoute, $attributes);

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

return $translatedRoute;
Expand Down

0 comments on commit 645819d

Please sign in to comment.