{"action":"created","issue":{"url":"https://api.github.com/repos/Greentube/localize-router/issues/20","repository_url":"https://api.github.com/repos/Greentube/localize-router","labels_url":"https://api.github.com/repos/Greentube/localize-router/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/Greentube/localize-router/issues/20/comments","events_url":"https://api.github.com/repos/Greentube/localize-router/issues/20/events","html_url":"https://github.com/Greentube/localize-router/issues/20","id":205454430,"number":20,"title":"no language in path doesn't use default","user":{"login":"Masquer","id":1760677,"avatar_url":"https://avatars.githubusercontent.com/u/1760677?v=3","gravatar_id":"","url":"https://api.github.com/users/Masquer","html_url":"https://github.com/Masquer","followers_url":"https://api.github.com/users/Masquer/followers","following_url":"https://api.github.com/users/Masquer/following{/other_user}","gists_url":"https://api.github.com/users/Masquer/gists{/gist_id}","starred_url":"https://api.github.com/users/Masquer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Masquer/subscriptions","organizations_url":"https://api.github.com/users/Masquer/orgs","repos_url":"https://api.github.com/users/Masquer/repos","events_url":"https://api.github.com/users/Masquer/events{/privacy}","received_events_url":"https://api.github.com/users/Masquer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-05T21:07:07Z","updated_at":"2017-02-06T09:06:54Z","closed_at":null,"body":"Here's the quote from README:\r\n> If no language is provided in the url path, application uses default path - language set in the browser or first locale in the config. Make sure you therefore place most common language (e.g. 'en') as a first string in the array of locales.\r\n\r\nBut I don't notice the behavior described; the [demo app](https://github.com/meeroslav/localize-router-example) also acts the other way.\r\n\r\nSteps to reproduce in demo app:\r\n- navigate somewhere (i.e.) to '/en/users' -- it works\r\n- type in path without language, as '/users' -- it doesn't work\r\n\r\nDesired behavior -- '/users' auto redirects to '/en/users' as first and default language, please any tips to meet that?"},"comment":{"url":"https://api.github.com/repos/Greentube/localize-router/issues/comments/277622181","html_url":"https://github.com/Greentube/localize-router/issues/20#issuecomment-277622181","issue_url":"https://api.github.com/repos/Greentube/localize-router/issues/20","id":277622181,"user":{"login":"meeroslav","id":881612,"avatar_url":"https://avatars.githubusercontent.com/u/881612?v=3","gravatar_id":"","url":"https://api.github.com/users/meeroslav","html_url":"https://github.com/meeroslav","followers_url":"https://api.github.com/users/meeroslav/followers","following_url":"https://api.github.com/users/meeroslav/following{/other_user}","gists_url":"https://api.github.com/users/meeroslav/gists{/gist_id}","starred_url":"https://api.github.com/users/meeroslav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meeroslav/subscriptions","organizations_url":"https://api.github.com/users/meeroslav/orgs","repos_url":"https://api.github.com/users/meeroslav/repos","events_url":"https://api.github.com/users/meeroslav/events{/privacy}","received_events_url":"https://api.github.com/users/meeroslav/received_events","type":"User","site_admin":false},"created_at":"2017-02-06T09:06:54Z","updated_at":"2017-02-06T09:06:54Z","body":"Hi @Masquer, it might be that documentation is a bit misleading. Thanks for pointing that out. Documentation only explains the algorithm by which language gets chosen.\r\n\r\nLocalize-router prepends all the routes with selected language and creates a redirect to base language url e.g. `my/route/path` will become `en/my/route/path`. Once localize-router had been initialized it overrides the initial routes, so route `my/route/path` no longer exists in RouterConfig and Router therefore returns 404. This is not defect, it's by design as above mentioned route is invalid.\r\n\r\nThere are two approaches to solve your request:\r\n- By catching 404 and redirecting to {localize.parser.currentLang}/{location.path} manually in project\r\n- By handling this in localize-router\r\n\r\nPlease note that at the moment this has low prio against lazy loading, and most likely will not be implemented any time soon."}}
{"actor":{"display_login":"meeroslav"}}