{"action":"created","comment":{"url":"https://api.github.com/repos/rainlab/translate-plugin/pulls/comments/149829683","pull_request_review_id":75287970,"id":149829683,"diff_hunk":"@@ -0,0 +1,3 @@\n+{% for locale, alternateUrl in __SELF__.locales %}\n+    <link rel=\"alternate\" hreflang=\"{{ locale }}\" href=\"{{ url(alternateUrl) }}\" />","path":"components/alternatehreflangelements/default.htm","position":2,"original_position":2,"commit_id":"b580f87464f9e16ccb7bc0fab7a19ae8c121593c","original_commit_id":"b580f87464f9e16ccb7bc0fab7a19ae8c121593c","user":{"login":"vannut","id":7419859,"avatar_url":"https://avatars3.githubusercontent.com/u/7419859?v=4","gravatar_id":"","url":"https://api.github.com/users/vannut","html_url":"https://github.com/vannut","followers_url":"https://api.github.com/users/vannut/followers","following_url":"https://api.github.com/users/vannut/following{/other_user}","gists_url":"https://api.github.com/users/vannut/gists{/gist_id}","starred_url":"https://api.github.com/users/vannut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vannut/subscriptions","organizations_url":"https://api.github.com/users/vannut/orgs","repos_url":"https://api.github.com/users/vannut/repos","events_url":"https://api.github.com/users/vannut/events{/privacy}","received_events_url":"https://api.github.com/users/vannut/received_events","type":"User","site_admin":false},"body":"It is a helper for  [`URLGenerator->to($path)`](https://github.com/laravel/framework/blob/5.5/src/Illuminate/Routing/UrlGenerator.php#L170)\r\n\r\n","created_at":"2017-11-08T23:36:57Z","updated_at":"2017-11-08T23:36:57Z","html_url":"https://github.com/rainlab/translate-plugin/pull/318#discussion_r149829683","pull_request_url":"https://api.github.com/repos/rainlab/translate-plugin/pulls/318","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rainlab/translate-plugin/pulls/comments/149829683"},"html":{"href":"https://github.com/rainlab/translate-plugin/pull/318#discussion_r149829683"},"pull_request":{"href":"https://api.github.com/repos/rainlab/translate-plugin/pulls/318"}},"in_reply_to_id":149770548},"pull_request":{"url":"https://api.github.com/repos/rainlab/translate-plugin/pulls/318","id":150803682,"html_url":"https://github.com/rainlab/translate-plugin/pull/318","diff_url":"https://github.com/rainlab/translate-plugin/pull/318.diff","patch_url":"https://github.com/rainlab/translate-plugin/pull/318.patch","issue_url":"https://api.github.com/repos/rainlab/translate-plugin/issues/318","number":318,"state":"open","locked":false,"title":"PrefixDefaultLocale setting and Alt hreflang element","user":{"login":"vannut","id":7419859,"avatar_url":"https://avatars3.githubusercontent.com/u/7419859?v=4","gravatar_id":"","url":"https://api.github.com/users/vannut","html_url":"https://github.com/vannut","followers_url":"https://api.github.com/users/vannut/followers","following_url":"https://api.github.com/users/vannut/following{/other_user}","gists_url":"https://api.github.com/users/vannut/gists{/gist_id}","starred_url":"https://api.github.com/users/vannut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vannut/subscriptions","organizations_url":"https://api.github.com/users/vannut/orgs","repos_url":"https://api.github.com/users/vannut/repos","events_url":"https://api.github.com/users/vannut/events{/privacy}","received_events_url":"https://api.github.com/users/vannut/received_events","type":"User","site_admin":false},"body":"This PR adds two things to the translate plugin:\r\n1 - A component which renders alt hreflang elements \r\n2 - adds a setting to ask if we need to prefix the default locale\r\n\r\n## Alternate hreflang elements\r\nAccording to [Google's locale recommendations](https://support.google.com/webmasters/answer/189077) we need to inject alternative languages in the head of a website as following:\r\n```html\r\n<link rel=\"alternate\" hreflang=\"en\" href=\"/en\" />\r\n<link rel=\"alternate\" hreflang=\"nl\" href=\"/nl\" />\r\n```\r\nThis needs to be done for _every_ language including the current language.\r\n\r\nWhen creating this component, the fact I didn't want to have the default locale prefixed, issue #315 regarding the behaviour when redirecting to the default locale and PR #317 let me to alter the behaviour of the forceurl redirect-method, the second part of this PR\r\n\r\n## prefixDefaultLocale\r\nYou can override the setting locally in [your own config file.](http://octobercms.com/docs/plugin/settings#file-configuration)\r\nWhat it does: \r\nWhen having `forceURL schema = true` and `prefixDefaultLocale=false` the website wont redirect the default locale to `/default_locale/...` Instead it just remains on the main-root.\r\nTo make sure the main root does not display the session-stored locale; the session locale gets reset in the same method :)\r\nIf you leave `prefixDefaultLocale=true` nothing should change :)\r\n\r\n\r\n","created_at":"2017-11-06T09:26:05Z","updated_at":"2017-11-08T23:36:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f2e768d2afa3bb13de456d7412e20033627ed5e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/rainlab/translate-plugin/pulls/318/commits","review_comments_url":"https://api.github.com/repos/rainlab/translate-plugin/pulls/318/comments","review_comment_url":"https://api.github.com/repos/rainlab/translate-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rainlab/translate-plugin/issues/318/comments","statuses_url":"https://api.github.com/repos/rainlab/translate-plugin/statuses/b580f87464f9e16ccb7bc0fab7a19ae8c121593c","head":{"label":"vannut:alternate-hreflang","ref":"alternate-hreflang","sha":"b580f87464f9e16ccb7bc0fab7a19ae8c121593c","user":{"login":"vannut","id":7419859,"avatar_url":"https://avatars3.githubusercontent.com/u/7419859?v=4","gravatar_id":"","url":"https://api.github.com/users/vannut","html_url":"https://github.com/vannut","followers_url":"https://api.github.com/users/vannut/followers","following_url":"https://api.github.com/users/vannut/following{/other_user}","gists_url":"https://api.github.com/users/vannut/gists{/gist_id}","starred_url":"https://api.github.com/users/vannut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vannut/subscriptions","organizations_url":"https://api.github.com/users/vannut/orgs","repos_url":"https://api.github.com/users/vannut/repos","events_url":"https://api.github.com/users/vannut/events{/privacy}","received_events_url":"https://api.github.com/users/vannut/received_events","type":"User","site_admin":false},"repo":{"id":109284362,"name":"translate-plugin","full_name":"vannut/translate-plugin","owner":{"login":"vannut","id":7419859,"avatar_url":"https://avatars3.githubusercontent.com/u/7419859?v=4","gravatar_id":"","url":"https://api.github.com/users/vannut","html_url":"https://github.com/vannut","followers_url":"https://api.github.com/users/vannut/followers","following_url":"https://api.github.com/users/vannut/following{/other_user}","gists_url":"https://api.github.com/users/vannut/gists{/gist_id}","starred_url":"https://api.github.com/users/vannut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vannut/subscriptions","organizations_url":"https://api.github.com/users/vannut/orgs","repos_url":"https://api.github.com/users/vannut/repos","events_url":"https://api.github.com/users/vannut/events{/privacy}","received_events_url":"https://api.github.com/users/vannut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vannut/translate-plugin","description":"Enables multi-lingual sites","fork":true,"url":"https://api.github.com/repos/vannut/translate-plugin","forks_url":"https://api.github.com/repos/vannut/translate-plugin/forks","keys_url":"https://api.github.com/repos/vannut/translate-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vannut/translate-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vannut/translate-plugin/teams","hooks_url":"https://api.github.com/repos/vannut/translate-plugin/hooks","issue_events_url":"https://api.github.com/repos/vannut/translate-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/vannut/translate-plugin/events","assignees_url":"https://api.github.com/repos/vannut/translate-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/vannut/translate-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/vannut/translate-plugin/tags","blobs_url":"https://api.github.com/repos/vannut/translate-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vannut/translate-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vannut/translate-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/vannut/translate-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vannut/translate-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/vannut/translate-plugin/languages","stargazers_url":"https://api.github.com/repos/vannut/translate-plugin/stargazers","contributors_url":"https://api.github.com/repos/vannut/translate-plugin/contributors","subscribers_url":"https://api.github.com/repos/vannut/translate-plugin/subscribers","subscription_url":"https://api.github.com/repos/vannut/translate-plugin/subscription","commits_url":"https://api.github.com/repos/vannut/translate-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/vannut/translate-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/vannut/translate-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/vannut/translate-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/vannut/translate-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/vannut/translate-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vannut/translate-plugin/merges","archive_url":"https://api.github.com/repos/vannut/translate-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vannut/translate-plugin/downloads","issues_url":"https://api.github.com/repos/vannut/translate-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/vannut/translate-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/vannut/translate-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/vannut/translate-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vannut/translate-plugin/labels{/name}","releases_url":"https://api.github.com/repos/vannut/translate-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/vannut/translate-plugin/deployments","created_at":"2017-11-02T15:38:04Z","updated_at":"2017-11-02T15:38:06Z","pushed_at":"2017-11-08T16:03:43Z","git_url":"git://github.com/vannut/translate-plugin.git","ssh_url":"git@github.com:vannut/translate-plugin.git","clone_url":"https://github.com/vannut/translate-plugin.git","svn_url":"https://github.com/vannut/translate-plugin","homepage":null,"size":354,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rainlab:master","ref":"master","sha":"0008eb35537eb63ee5b9e87942188ba030c57ac8","user":{"login":"rainlab","id":6005764,"avatar_url":"https://avatars3.githubusercontent.com/u/6005764?v=4","gravatar_id":"","url":"https://api.github.com/users/rainlab","html_url":"https://github.com/rainlab","followers_url":"https://api.github.com/users/rainlab/followers","following_url":"https://api.github.com/users/rainlab/following{/other_user}","gists_url":"https://api.github.com/users/rainlab/gists{/gist_id}","starred_url":"https://api.github.com/users/rainlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainlab/subscriptions","organizations_url":"https://api.github.com/users/rainlab/orgs","repos_url":"https://api.github.com/users/rainlab/repos","events_url":"https://api.github.com/users/rainlab/events{/privacy}","received_events_url":"https://api.github.com/users/rainlab/received_events","type":"Organization","site_admin":false},"repo":{"id":21813668,"name":"translate-plugin","full_name":"rainlab/translate-plugin","owner":{"login":"rainlab","id":6005764,"avatar_url":"https://avatars3.githubusercontent.com/u/6005764?v=4","gravatar_id":"","url":"https://api.github.com/users/rainlab","html_url":"https://github.com/rainlab","followers_url":"https://api.github.com/users/rainlab/followers","following_url":"https://api.github.com/users/rainlab/following{/other_user}","gists_url":"https://api.github.com/users/rainlab/gists{/gist_id}","starred_url":"https://api.github.com/users/rainlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainlab/subscriptions","organizations_url":"https://api.github.com/users/rainlab/orgs","repos_url":"https://api.github.com/users/rainlab/repos","events_url":"https://api.github.com/users/rainlab/events{/privacy}","received_events_url":"https://api.github.com/users/rainlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rainlab/translate-plugin","description":"Enables multi-lingual sites","fork":false,"url":"https://api.github.com/repos/rainlab/translate-plugin","forks_url":"https://api.github.com/repos/rainlab/translate-plugin/forks","keys_url":"https://api.github.com/repos/rainlab/translate-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rainlab/translate-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rainlab/translate-plugin/teams","hooks_url":"https://api.github.com/repos/rainlab/translate-plugin/hooks","issue_events_url":"https://api.github.com/repos/rainlab/translate-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/rainlab/translate-plugin/events","assignees_url":"https://api.github.com/repos/rainlab/translate-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/rainlab/translate-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/rainlab/translate-plugin/tags","blobs_url":"https://api.github.com/repos/rainlab/translate-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rainlab/translate-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rainlab/translate-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/rainlab/translate-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rainlab/translate-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/rainlab/translate-plugin/languages","stargazers_url":"https://api.github.com/repos/rainlab/translate-plugin/stargazers","contributors_url":"https://api.github.com/repos/rainlab/translate-plugin/contributors","subscribers_url":"https://api.github.com/repos/rainlab/translate-plugin/subscribers","subscription_url":"https://api.github.com/repos/rainlab/translate-plugin/subscription","commits_url":"https://api.github.com/repos/rainlab/translate-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/rainlab/translate-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/rainlab/translate-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/rainlab/translate-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/rainlab/translate-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/rainlab/translate-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rainlab/translate-plugin/merges","archive_url":"https://api.github.com/repos/rainlab/translate-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rainlab/translate-plugin/downloads","issues_url":"https://api.github.com/repos/rainlab/translate-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/rainlab/translate-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/rainlab/translate-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/rainlab/translate-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rainlab/translate-plugin/labels{/name}","releases_url":"https://api.github.com/repos/rainlab/translate-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/rainlab/translate-plugin/deployments","created_at":"2014-07-14T09:07:20Z","updated_at":"2017-11-01T12:30:36Z","pushed_at":"2017-11-08T16:03:44Z","git_url":"git://github.com/rainlab/translate-plugin.git","ssh_url":"git@github.com:rainlab/translate-plugin.git","clone_url":"https://github.com/rainlab/translate-plugin.git","svn_url":"https://github.com/rainlab/translate-plugin","homepage":null,"size":339,"stargazers_count":75,"watchers_count":75,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"archived":false,"open_issues_count":24,"forks":64,"open_issues":24,"watchers":75,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rainlab/translate-plugin/pulls/318"},"html":{"href":"https://github.com/rainlab/translate-plugin/pull/318"},"issue":{"href":"https://api.github.com/repos/rainlab/translate-plugin/issues/318"},"comments":{"href":"https://api.github.com/repos/rainlab/translate-plugin/issues/318/comments"},"review_comments":{"href":"https://api.github.com/repos/rainlab/translate-plugin/pulls/318/comments"},"review_comment":{"href":"https://api.github.com/repos/rainlab/translate-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rainlab/translate-plugin/pulls/318/commits"},"statuses":{"href":"https://api.github.com/repos/rainlab/translate-plugin/statuses/b580f87464f9e16ccb7bc0fab7a19ae8c121593c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vannut"}}