{"action":"created","comment":{"url":"https://api.github.com/repos/zendesk/timetracking_app/pulls/comments/72169123","id":72169123,"diff_hunk":"@@ -291,7 +291,18 @@\n           });\n \n           if (!valid) {\n-            this.switchTo('setup_info', { link: this.SETUP_INFO });\n+            var localeString = this.currentUser().locale().toLowerCase();\n+            if (localeString.indexOf('pt') === 0) {\n+              localeString = 'pt-br';\n+            } else if (localeString.indexOf('en') === 0) {\n+              localeString = 'en-us';\n+            } else if (localeString.indexOf('es') == 0) {\n+              localeString = 'es';\n+            } else if (localeString.indexOf('fr') === 0) {\n+              localeString = 'fr';\n+            }","path":"app.js","position":23,"original_position":23,"commit_id":"ca5264bbdacde753ddca9ba7c87779b7ee5e4c8a","original_commit_id":"ca5264bbdacde753ddca9ba7c87779b7ee5e4c8a","user":{"login":"danielbreves","id":2517811,"avatar_url":"https://avatars.githubusercontent.com/u/2517811?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbreves","html_url":"https://github.com/danielbreves","followers_url":"https://api.github.com/users/danielbreves/followers","following_url":"https://api.github.com/users/danielbreves/following{/other_user}","gists_url":"https://api.github.com/users/danielbreves/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbreves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbreves/subscriptions","organizations_url":"https://api.github.com/users/danielbreves/orgs","repos_url":"https://api.github.com/users/danielbreves/repos","events_url":"https://api.github.com/users/danielbreves/events{/privacy}","received_events_url":"https://api.github.com/users/danielbreves/received_events","type":"User","site_admin":false},"body":"Can you extract this to a helper? It's quite a large function already.","created_at":"2016-07-26T00:21:52Z","updated_at":"2016-07-26T00:21:52Z","html_url":"https://github.com/zendesk/timetracking_app/pull/74#discussion_r72169123","pull_request_url":"https://api.github.com/repos/zendesk/timetracking_app/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/zendesk/timetracking_app/pulls/comments/72169123"},"html":{"href":"https://github.com/zendesk/timetracking_app/pull/74#discussion_r72169123"},"pull_request":{"href":"https://api.github.com/repos/zendesk/timetracking_app/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/zendesk/timetracking_app/pulls/74","id":77921068,"html_url":"https://github.com/zendesk/timetracking_app/pull/74","diff_url":"https://github.com/zendesk/timetracking_app/pull/74.diff","patch_url":"https://github.com/zendesk/timetracking_app/pull/74.patch","issue_url":"https://api.github.com/repos/zendesk/timetracking_app/issues/74","number":74,"state":"open","locked":false,"title":"OFFAPPS-756 localise the setup link","user":{"login":"sandlerr","id":5535625,"avatar_url":"https://avatars.githubusercontent.com/u/5535625?v=3","gravatar_id":"","url":"https://api.github.com/users/sandlerr","html_url":"https://github.com/sandlerr","followers_url":"https://api.github.com/users/sandlerr/followers","following_url":"https://api.github.com/users/sandlerr/following{/other_user}","gists_url":"https://api.github.com/users/sandlerr/gists{/gist_id}","starred_url":"https://api.github.com/users/sandlerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandlerr/subscriptions","organizations_url":"https://api.github.com/users/sandlerr/orgs","repos_url":"https://api.github.com/users/sandlerr/repos","events_url":"https://api.github.com/users/sandlerr/events{/privacy}","received_events_url":"https://api.github.com/users/sandlerr/received_events","type":"User","site_admin":false},"body":"https://zendesk.atlassian.net/browse/OFFAPPS-756\r\n\r\nThis falls back to whatever language you last chose in the HC dropdown, unlike the `/entries` URL - not sure how that works but in my testing it seemed to either go to English or a 404 page.\r\n\r\n@zendesk/vegemite \r\n\r\n### Risks\r\n- users are taken to a non-working page or a wrong-language page when clicking the setup link within the timetracking app","created_at":"2016-07-19T05:50:43Z","updated_at":"2016-07-26T00:21:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"793a2a9d0f624128afe81ede92f43c3a0f553fd8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zendesk/timetracking_app/pulls/74/commits","review_comments_url":"https://api.github.com/repos/zendesk/timetracking_app/pulls/74/comments","review_comment_url":"https://api.github.com/repos/zendesk/timetracking_app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendesk/timetracking_app/issues/74/comments","statuses_url":"https://api.github.com/repos/zendesk/timetracking_app/statuses/ca5264bbdacde753ddca9ba7c87779b7ee5e4c8a","head":{"label":"zendesk:roman/localised-link","ref":"roman/localised-link","sha":"ca5264bbdacde753ddca9ba7c87779b7ee5e4c8a","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":18617077,"name":"timetracking_app","full_name":"zendesk/timetracking_app","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/timetracking_app","description":"Zendesk official time-tracking app","fork":false,"url":"https://api.github.com/repos/zendesk/timetracking_app","forks_url":"https://api.github.com/repos/zendesk/timetracking_app/forks","keys_url":"https://api.github.com/repos/zendesk/timetracking_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/timetracking_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/timetracking_app/teams","hooks_url":"https://api.github.com/repos/zendesk/timetracking_app/hooks","issue_events_url":"https://api.github.com/repos/zendesk/timetracking_app/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/timetracking_app/events","assignees_url":"https://api.github.com/repos/zendesk/timetracking_app/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/timetracking_app/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/timetracking_app/tags","blobs_url":"https://api.github.com/repos/zendesk/timetracking_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/timetracking_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/timetracking_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/timetracking_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/timetracking_app/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/timetracking_app/languages","stargazers_url":"https://api.github.com/repos/zendesk/timetracking_app/stargazers","contributors_url":"https://api.github.com/repos/zendesk/timetracking_app/contributors","subscribers_url":"https://api.github.com/repos/zendesk/timetracking_app/subscribers","subscription_url":"https://api.github.com/repos/zendesk/timetracking_app/subscription","commits_url":"https://api.github.com/repos/zendesk/timetracking_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/timetracking_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/timetracking_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/timetracking_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/timetracking_app/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/timetracking_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/timetracking_app/merges","archive_url":"https://api.github.com/repos/zendesk/timetracking_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/timetracking_app/downloads","issues_url":"https://api.github.com/repos/zendesk/timetracking_app/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/timetracking_app/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/timetracking_app/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/timetracking_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/timetracking_app/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/timetracking_app/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/timetracking_app/deployments","created_at":"2014-04-09T23:31:44Z","updated_at":"2016-05-17T21:50:11Z","pushed_at":"2016-07-22T01:13:04Z","git_url":"git://github.com/zendesk/timetracking_app.git","ssh_url":"git@github.com:zendesk/timetracking_app.git","clone_url":"https://github.com/zendesk/timetracking_app.git","svn_url":"https://github.com/zendesk/timetracking_app","homepage":null,"size":720,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":6,"forks":11,"open_issues":6,"watchers":8,"default_branch":"master"}},"base":{"label":"zendesk:master","ref":"master","sha":"e96cb506cee19402e89616ae775fc773fe9955a5","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":18617077,"name":"timetracking_app","full_name":"zendesk/timetracking_app","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/timetracking_app","description":"Zendesk official time-tracking app","fork":false,"url":"https://api.github.com/repos/zendesk/timetracking_app","forks_url":"https://api.github.com/repos/zendesk/timetracking_app/forks","keys_url":"https://api.github.com/repos/zendesk/timetracking_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/timetracking_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/timetracking_app/teams","hooks_url":"https://api.github.com/repos/zendesk/timetracking_app/hooks","issue_events_url":"https://api.github.com/repos/zendesk/timetracking_app/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/timetracking_app/events","assignees_url":"https://api.github.com/repos/zendesk/timetracking_app/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/timetracking_app/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/timetracking_app/tags","blobs_url":"https://api.github.com/repos/zendesk/timetracking_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/timetracking_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/timetracking_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/timetracking_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/timetracking_app/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/timetracking_app/languages","stargazers_url":"https://api.github.com/repos/zendesk/timetracking_app/stargazers","contributors_url":"https://api.github.com/repos/zendesk/timetracking_app/contributors","subscribers_url":"https://api.github.com/repos/zendesk/timetracking_app/subscribers","subscription_url":"https://api.github.com/repos/zendesk/timetracking_app/subscription","commits_url":"https://api.github.com/repos/zendesk/timetracking_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/timetracking_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/timetracking_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/timetracking_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/timetracking_app/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/timetracking_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/timetracking_app/merges","archive_url":"https://api.github.com/repos/zendesk/timetracking_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/timetracking_app/downloads","issues_url":"https://api.github.com/repos/zendesk/timetracking_app/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/timetracking_app/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/timetracking_app/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/timetracking_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/timetracking_app/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/timetracking_app/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/timetracking_app/deployments","created_at":"2014-04-09T23:31:44Z","updated_at":"2016-05-17T21:50:11Z","pushed_at":"2016-07-22T01:13:04Z","git_url":"git://github.com/zendesk/timetracking_app.git","ssh_url":"git@github.com:zendesk/timetracking_app.git","clone_url":"https://github.com/zendesk/timetracking_app.git","svn_url":"https://github.com/zendesk/timetracking_app","homepage":null,"size":720,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":6,"forks":11,"open_issues":6,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendesk/timetracking_app/pulls/74"},"html":{"href":"https://github.com/zendesk/timetracking_app/pull/74"},"issue":{"href":"https://api.github.com/repos/zendesk/timetracking_app/issues/74"},"comments":{"href":"https://api.github.com/repos/zendesk/timetracking_app/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/zendesk/timetracking_app/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/zendesk/timetracking_app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendesk/timetracking_app/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/zendesk/timetracking_app/statuses/ca5264bbdacde753ddca9ba7c87779b7ee5e4c8a"}}}}
{"actor":{"display_login":"danielbreves"}}