diff --git a/composer.json b/composer.json index 2b210d5..32fea8b 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["localization", "laravel", "php"], "homepage": "https://github.com/mcamara/laravel-localization", "license": "MIT", - "version": "1.0.3", + "version": "1.0.4", "authors": [ { "name": "Marc Cámara", diff --git a/src/Mcamara/LaravelLocalization/LanguageNegotiator.php b/src/Mcamara/LaravelLocalization/LanguageNegotiator.php index 90f7d2d..2af12ed 100644 --- a/src/Mcamara/LaravelLocalization/LanguageNegotiator.php +++ b/src/Mcamara/LaravelLocalization/LanguageNegotiator.php @@ -1,7 +1,4 @@ -extractAttributes($path); + $path = str_replace(url(), "", $path); if ( $path[ 0 ] !== '/' ) { @@ -664,12 +666,11 @@ public function getRouteNameFromAPath( $path ) foreach ( $this->translatedRoutes as $route ) { - if ( $this->translator->trans($route) == $path ) + if ( $this->substituteAttributesInRoute( $attributes, $this->translator->trans($route)) === $path ) { return $route; } } - return false; }