Skip to content

Commit 5af9bc3

Browse files
author
Marc Cámara
committed
fixed #170 and #171
1 parent 88772e7 commit 5af9bc3

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"keywords": ["localization", "laravel", "php"],
55
"homepage": "https://github.com/mcamara/laravel-localization",
66
"license": "MIT",
7-
"version": "1.0.3",
7+
"version": "1.0.4",
88
"authors": [
99
{
1010
"name": "Marc Cámara",

src/Mcamara/LaravelLocalization/LanguageNegotiator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
<?php
2-
3-
namespace Mcamara\LaravelLocalization;
4-
1+
<?php namespace Mcamara\LaravelLocalization;
52

63
use Locale;
74
use Illuminate\Http\Request;

src/Mcamara/LaravelLocalization/LaravelLocalization.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ public function transRoute( $routeName )
654654
*/
655655
public function getRouteNameFromAPath( $path )
656656
{
657+
$attributes = $this->extractAttributes($path);
658+
657659
$path = str_replace(url(), "", $path);
658660
if ( $path[ 0 ] !== '/' )
659661
{
@@ -664,12 +666,11 @@ public function getRouteNameFromAPath( $path )
664666

665667
foreach ( $this->translatedRoutes as $route )
666668
{
667-
if ( $this->translator->trans($route) == $path )
669+
if ( $this->substituteAttributesInRoute( $attributes, $this->translator->trans($route)) === $path )
668670
{
669671
return $route;
670672
}
671673
}
672-
673674
return false;
674675
}
675676

0 commit comments

Comments
 (0)