Skip to content

Commit

Permalink
fixed #170 and #171
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Cámara committed Feb 10, 2015
1 parent 88772e7 commit 5af9bc3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 1 addition & 4 deletions src/Mcamara/LaravelLocalization/LanguageNegotiator.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php

namespace Mcamara\LaravelLocalization;

<?php namespace Mcamara\LaravelLocalization;

use Locale;
use Illuminate\Http\Request;
Expand Down
5 changes: 3 additions & 2 deletions src/Mcamara/LaravelLocalization/LaravelLocalization.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ public function transRoute( $routeName )
*/
public function getRouteNameFromAPath( $path )
{
$attributes = $this->extractAttributes($path);

$path = str_replace(url(), "", $path);
if ( $path[ 0 ] !== '/' )
{
Expand All @@ -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;
}

Expand Down

0 comments on commit 5af9bc3

Please sign in to comment.