{"action":"created","issue":{"url":"https://api.github.com/repos/ARCANEDEV/Localization/issues/10","labels_url":"https://api.github.com/repos/ARCANEDEV/Localization/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/ARCANEDEV/Localization/issues/10/comments","events_url":"https://api.github.com/repos/ARCANEDEV/Localization/issues/10/events","html_url":"https://github.com/ARCANEDEV/Localization/issues/10","id":112458234,"number":10,"title":"Getting localized urls for nested route groups not working beyond first level of depth","user":{"login":"ovvessem","id":3148783,"avatar_url":"https://avatars.githubusercontent.com/u/3148783?v=3","gravatar_id":"","url":"https://api.github.com/users/ovvessem","html_url":"https://github.com/ovvessem","followers_url":"https://api.github.com/users/ovvessem/followers","following_url":"https://api.github.com/users/ovvessem/following{/other_user}","gists_url":"https://api.github.com/users/ovvessem/gists{/gist_id}","starred_url":"https://api.github.com/users/ovvessem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovvessem/subscriptions","organizations_url":"https://api.github.com/users/ovvessem/orgs","repos_url":"https://api.github.com/users/ovvessem/repos","events_url":"https://api.github.com/users/ovvessem/events{/privacy}","received_events_url":"https://api.github.com/users/ovvessem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"arcanedev-maroc","id":3282340,"avatar_url":"https://avatars.githubusercontent.com/u/3282340?v=3","gravatar_id":"","url":"https://api.github.com/users/arcanedev-maroc","html_url":"https://github.com/arcanedev-maroc","followers_url":"https://api.github.com/users/arcanedev-maroc/followers","following_url":"https://api.github.com/users/arcanedev-maroc/following{/other_user}","gists_url":"https://api.github.com/users/arcanedev-maroc/gists{/gist_id}","starred_url":"https://api.github.com/users/arcanedev-maroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcanedev-maroc/subscriptions","organizations_url":"https://api.github.com/users/arcanedev-maroc/orgs","repos_url":"https://api.github.com/users/arcanedev-maroc/repos","events_url":"https://api.github.com/users/arcanedev-maroc/events{/privacy}","received_events_url":"https://api.github.com/users/arcanedev-maroc/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-10-20T20:54:07Z","updated_at":"2015-10-20T21:21:08Z","closed_at":null,"body":"I have an issue where I cannot get nested route groups translated beyond the first level of depth when using the language switcher:\r\n\r\n```php\r\nRoute::localizedGroup(function () {\r\n    Route::transGet('routes.webhosting.colocation', ['as' => 'webhosting.colocation', 'uses' => 'WebhostIngcontroller@colocatie']);\r\n\r\n    Route::group(['prefix' => trans('routes.webhosting')], function () {\r\n\r\n    Route::transGet('routes.webhosting.colocation', ['as' => 'webhosting.colocation', 'uses' => 'WebhostIngcontroller@colocatie']);\r\n    });\r\n}); \r\n```\r\n\r\nThe first route within the localizedGroup does the job, but the one in the group doest first not translate the group prefix and second does not translate the route name when I want to switch the language.\r\n\r\nThe languages/[lang]/routes.php files looks like this:\r\n\r\n```php\r\nlanguages/en/routes.php\r\n    'webhosting'                        => 'hosting',\r\n    'webhosting.colocation'       => 'colocation',\r\n\r\nlanguages/nl/routes.php --> dutch\r\n    'webhosting'                        => 'webhosting',\r\n    'webhosting.colocation'       => 'colocatie',\r\n```\r\n\r\nI would assume the following routes when I change from one to the other language in the language switcher:\r\n```\r\nnl --> domain.app/nl/webhosting/colocatie\r\nen --> domain.app/en/hosting/colocation\r\n```\r\nBut I get the following switching from NL to EN\r\n```\r\nnl --> domain.app/nl/webhosting/colocatie\r\nen --> domain.app/en/webhosting/colocatie\r\n```\r\nI can work a round with attaching the prefix to the translation but that does not feels nice."},"comment":{"url":"https://api.github.com/repos/ARCANEDEV/Localization/issues/comments/149707026","html_url":"https://github.com/ARCANEDEV/Localization/issues/10#issuecomment-149707026","issue_url":"https://api.github.com/repos/ARCANEDEV/Localization/issues/10","id":149707026,"user":{"login":"arcanedev-maroc","id":3282340,"avatar_url":"https://avatars.githubusercontent.com/u/3282340?v=3","gravatar_id":"","url":"https://api.github.com/users/arcanedev-maroc","html_url":"https://github.com/arcanedev-maroc","followers_url":"https://api.github.com/users/arcanedev-maroc/followers","following_url":"https://api.github.com/users/arcanedev-maroc/following{/other_user}","gists_url":"https://api.github.com/users/arcanedev-maroc/gists{/gist_id}","starred_url":"https://api.github.com/users/arcanedev-maroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcanedev-maroc/subscriptions","organizations_url":"https://api.github.com/users/arcanedev-maroc/orgs","repos_url":"https://api.github.com/users/arcanedev-maroc/repos","events_url":"https://api.github.com/users/arcanedev-maroc/events{/privacy}","received_events_url":"https://api.github.com/users/arcanedev-maroc/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T21:21:08Z","updated_at":"2015-10-20T21:21:08Z","body":"In your `routes.php` for each locale, try this:\r\n```php\r\nreturn [\r\n    //...\r\n    'webhosting' => [\r\n        'prefix'     => 'webhosting',\r\n        'colocation' => 'colocatie',\r\n    ],\r\n];\r\n```\r\n\r\nAnd replace `'routes.webhosting'` by `'routes.webhosting.prefix'` like this :\r\n\r\n```php\r\nRoute::localizedGroup(function () {\r\n    Route::group(['prefix' => trans('routes.webhosting.prefix')], function () {\r\n        Route::transGet('routes.webhosting.colocation', [\r\n            'as'   => 'webhosting.colocation', // Dont duplicate routes with the same name\r\n            'uses' => 'WebhostIngcontroller@colocatie'\r\n        ]);\r\n    });\r\n}); \r\n```"}}