{"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:24:41Z","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/149707819","html_url":"https://github.com/ARCANEDEV/Localization/issues/10#issuecomment-149707819","issue_url":"https://api.github.com/repos/ARCANEDEV/Localization/issues/10","id":149707819,"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},"created_at":"2015-10-20T21:24:41Z","updated_at":"2015-10-20T21:24:41Z","body":"I have changed the routes.php like so:\r\n\r\n```php\r\n    'webhosting' => [\r\n        'prefix'     => 'webhosting',\r\n        'index'      => 'webhosting',\r\n        'shared'     => 'shared',\r\n        'vps'        => 'vps',\r\n        'colocation' => 'colocatie',\r\n        'reseller'   => 'reseller'\r\n    ]\r\n```\r\n\r\nI have the following route definition:\r\n\r\n```php\r\nRoute::localizedGroup(function () {\r\n    Route::group(['prefix' => trans('routes.webhosting.prefix')], function () {\r\n\r\n        dump(trans('routes.webhosting.prefix'));\r\n        dump(trans('routes.webhosting.colocation'));\r\n\r\n    // Route::get('/', ['as' => 'webhosting.index', 'uses' => 'WebhostIngcontroller@index']);\r\n    // Route::get(trans('routes.webhosting.shared'), ['as' => 'webhosting.shared', 'uses' => 'WebhostIngcontroller@shared']);\r\n    // Route::get(trans('routes.webhosting.reseller'), ['as' => 'webhosting.reseller', 'uses' => 'WebhostIngcontroller@reseller']);\r\n    // Route::get(trans('routes.webhosting.vps'), ['as' => 'webhosting.vps', 'uses' => 'WebhostIngcontroller@vps']);\r\n    // Route::get(trans('routes.webhosting.colocation'), ['as' => 'webhosting.colocation', 'uses' => 'WebhostIngcontroller@colocatie']);\r\n        Route::transGet('routes.webhosting.vps', [\r\n            'as'   => 'webhosting.vps', // Dont duplicate routes with the same name\r\n            'uses' => 'WebhostIngcontroller@colocatie'\r\n        ]);\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```\r\n\r\nWhen I change from language 'nl' to 'en' the dumps show the correct value but the language switcher url does not fetch the correct translation on time.\r\n\r\nChanged $supportedLocales to localization()->getSupportedLocales() in the navbar.blade.php to make it work.\r\n\r\n```html\r\n<ul class=\"navbar-locales\">\r\n    @foreach(localization()->getSupportedLocales() as $key => $locale)\r\n        <li class=\"{{ localization()->getCurrentLocale() == $key ? 'active' : '' }}\">\r\n            <a href=\"{{ localization()->getLocalizedURL($key) }}\" rel=\"alternate\" hreflang=\"{{ $key  }}\">\r\n                {{ $locale->native() }}\r\n            </a>\r\n        </li>\r\n    @endforeach\r\n</ul>\r\n```\r\n\r\nI hope I am clear enough if not please do not hesitate to ask for specifics.\r\n"}}