{"action":"created","issue":{"url":"https://api.github.com/repos/Waavi/translation/issues/49","repository_url":"https://api.github.com/repos/Waavi/translation","labels_url":"https://api.github.com/repos/Waavi/translation/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/Waavi/translation/issues/49/comments","events_url":"https://api.github.com/repos/Waavi/translation/issues/49/events","html_url":"https://github.com/Waavi/translation/issues/49","id":160260745,"number":49,"title":"\"Class translation.uri.localizer does not exist\" using UriLocalizer in route prefix","user":{"login":"mikeu","id":605493,"avatar_url":"https://avatars.githubusercontent.com/u/605493?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeu","html_url":"https://github.com/mikeu","followers_url":"https://api.github.com/users/mikeu/followers","following_url":"https://api.github.com/users/mikeu/following{/other_user}","gists_url":"https://api.github.com/users/mikeu/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeu/subscriptions","organizations_url":"https://api.github.com/users/mikeu/orgs","repos_url":"https://api.github.com/users/mikeu/repos","events_url":"https://api.github.com/users/mikeu/events{/privacy}","received_events_url":"https://api.github.com/users/mikeu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-14T19:12:28Z","updated_at":"2016-06-15T01:17:57Z","closed_at":null,"body":"I am trying to add this translation package to an existing Laravel 5.2 project. I was previously using a different package for localizing just URIs ([Laravel Localization](https://github.com/mcamara/laravel-localization)) but removed it before installing the Waavi translation package. After installing and configuring this package, and adding `'prefix' => UriLocalizer::localeFromRequest()` to my routes, an exception is thrown with the following error:\r\n\r\n```\r\nReflectionException in Container.php line 738:\r\nClass translation.uri.localizer does not exist\r\n```\r\n\r\nWhile attempting to debug the problem I found that when Laravel compiles the manifest of service providers, it creates deferred services for `translator` and `translation.loader` because these are in the array returned by the `provides()` method that the Waavi `TranslationServiceProvider` inherits from `LaravelTranslationServiceProvider`. But the string `translation.uri.localizer` doesn't appear anywhere in my `bootstrap/cache/services.php` file, even after manually deleting it to force a recompilation.\r\n\r\nIt seems as if the exception is being thrown _before_ the `register()` method of your TranslationServiceProvider is being called, which might be part of the problem, I'm not sure.\r\n\r\nPlease let me know what else I can try, or what other information/tests would be helpful to resolve this issue. Your translation package looks great, and I'd love to be able to start using it. Thanks!"},"comment":{"url":"https://api.github.com/repos/Waavi/translation/issues/comments/226062978","html_url":"https://github.com/Waavi/translation/issues/49#issuecomment-226062978","issue_url":"https://api.github.com/repos/Waavi/translation/issues/49","id":226062978,"user":{"login":"cirdog","id":172924,"avatar_url":"https://avatars.githubusercontent.com/u/172924?v=3","gravatar_id":"","url":"https://api.github.com/users/cirdog","html_url":"https://github.com/cirdog","followers_url":"https://api.github.com/users/cirdog/followers","following_url":"https://api.github.com/users/cirdog/following{/other_user}","gists_url":"https://api.github.com/users/cirdog/gists{/gist_id}","starred_url":"https://api.github.com/users/cirdog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cirdog/subscriptions","organizations_url":"https://api.github.com/users/cirdog/orgs","repos_url":"https://api.github.com/users/cirdog/repos","events_url":"https://api.github.com/users/cirdog/events{/privacy}","received_events_url":"https://api.github.com/users/cirdog/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T01:17:57Z","updated_at":"2016-06-15T01:17:57Z","body":"Hi Mike,\r\n\r\nTry adding this to either the vendor's TranslationServiceProvider or to your own subclass of it.\r\n\r\n```\r\n    public function provides()\r\n    {\r\n        return array_merge(parent::provides(), ['translation.cache.repository', 'translation.uri.localizer']);\r\n    }\r\n```\r\n\r\nThis extends the Lavarel's stock TranslationServiceProvider to account for the added services. Please give it a try and be sure to delete services.php just to be safe.\r\n\r\nPlease let us know the result."}}
{"actor":{"display_login":"cirdog"}}