{"action":"created","comment":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/72203343","id":72203343,"diff_hunk":"@@ -0,0 +1,52 @@\n+<?php\n+\n+namespace Sylius\\Bundle\\LocaleBundle\\Listener;\n+\n+use Sylius\\Component\\Locale\\Context\\LocaleContextInterface;\n+use Sylius\\Component\\Locale\\Context\\LocaleNotFoundException;\n+use Sylius\\Component\\Locale\\Provider\\LocaleProviderInterface;\n+use Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent;\n+\n+/**\n+ * @author Kamil Kokot <kamil.kokot@lakion.com>\n+ */\n+final class RequestLocaleSetter\n+{\n+    /**\n+     * @var LocaleContextInterface\n+     */\n+    private $localeContext;\n+\n+    /**\n+     * @var LocaleProviderInterface\n+     */\n+    private $localeProvider;\n+\n+    /**\n+     * @param LocaleContextInterface $localeContext\n+     * @param LocaleProviderInterface $localeProvider\n+     */\n+    public function __construct(\n+        LocaleContextInterface $localeContext,\n+        LocaleProviderInterface $localeProvider\n+    ) {\n+        $this->localeContext = $localeContext;\n+        $this->localeProvider = $localeProvider;\n+    }\n+\n+    /**\n+     * @param GetResponseEvent $event\n+     */\n+    public function onKernelRequest(GetResponseEvent $event)\n+    {\n+        $request = $event->getRequest();\n+\n+        try {\n+            $request->setLocale($this->localeContext->getLocaleCode());\n+        } catch (LocaleNotFoundException $exception) {}\n+\n+        try {\n+            $request->setDefaultLocale($this->localeProvider->getDefaultLocaleCode());\n+        } catch (LocaleNotFoundException $exception) {}","path":"src/Sylius/Bundle/LocaleBundle/Listener/RequestLocaleSetter.php","position":50,"original_position":50,"commit_id":"61ae7dfc886eea59b1b16b0b51cb0b146beccd4b","original_commit_id":"61ae7dfc886eea59b1b16b0b51cb0b146beccd4b","user":{"login":"pamil","id":1897953,"avatar_url":"https://avatars.githubusercontent.com/u/1897953?v=3","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"body":"Had some reasoning about it, but can't recall it. I'll take a look & think how to manage this in #5601.","created_at":"2016-07-26T07:53:04Z","updated_at":"2016-07-26T07:53:04Z","html_url":"https://github.com/Sylius/Sylius/pull/5597#discussion_r72203343","pull_request_url":"https://api.github.com/repos/Sylius/Sylius/pulls/5597","_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/72203343"},"html":{"href":"https://github.com/Sylius/Sylius/pull/5597#discussion_r72203343"},"pull_request":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/5597"}}},"pull_request":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/5597","id":78667752,"html_url":"https://github.com/Sylius/Sylius/pull/5597","diff_url":"https://github.com/Sylius/Sylius/pull/5597.diff","patch_url":"https://github.com/Sylius/Sylius/pull/5597.patch","issue_url":"https://api.github.com/repos/Sylius/Sylius/issues/5597","number":5597,"state":"closed","locked":false,"title":"[Locale] Locale refactoring","user":{"login":"pamil","id":1897953,"avatar_url":"https://avatars.githubusercontent.com/u/1897953?v=3","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"body":"| Q               | A\r\n| --------------- | ---\r\n| Bug fix?        | yes\r\n| New feature?    | yes\r\n| BC breaks?      | yes\r\n| Related tickets | -\r\n| License         | MIT\r\n\r\nBasically the same as currency refactoring in #5497, but much simplier :)","created_at":"2016-07-25T11:46:59Z","updated_at":"2016-07-26T07:53:04Z","closed_at":"2016-07-26T07:31:23Z","merged_at":"2016-07-26T07:31:23Z","merge_commit_sha":"3b7e1bebe759f7683b2eea8d6b97651bccf03427","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Sylius/Sylius/pulls/5597/commits","review_comments_url":"https://api.github.com/repos/Sylius/Sylius/pulls/5597/comments","review_comment_url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/5597/comments","statuses_url":"https://api.github.com/repos/Sylius/Sylius/statuses/61ae7dfc886eea59b1b16b0b51cb0b146beccd4b","head":{"label":"pamil:context/locale","ref":"context/locale","sha":"61ae7dfc886eea59b1b16b0b51cb0b146beccd4b","user":{"login":"pamil","id":1897953,"avatar_url":"https://avatars.githubusercontent.com/u/1897953?v=3","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"repo":{"id":33619140,"name":"Sylius","full_name":"pamil/Sylius","owner":{"login":"pamil","id":1897953,"avatar_url":"https://avatars.githubusercontent.com/u/1897953?v=3","gravatar_id":"","url":"https://api.github.com/users/pamil","html_url":"https://github.com/pamil","followers_url":"https://api.github.com/users/pamil/followers","following_url":"https://api.github.com/users/pamil/following{/other_user}","gists_url":"https://api.github.com/users/pamil/gists{/gist_id}","starred_url":"https://api.github.com/users/pamil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pamil/subscriptions","organizations_url":"https://api.github.com/users/pamil/orgs","repos_url":"https://api.github.com/users/pamil/repos","events_url":"https://api.github.com/users/pamil/events{/privacy}","received_events_url":"https://api.github.com/users/pamil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pamil/Sylius","description":"Modern e-commerce for PHP, based on the Symfony2 framework.","fork":true,"url":"https://api.github.com/repos/pamil/Sylius","forks_url":"https://api.github.com/repos/pamil/Sylius/forks","keys_url":"https://api.github.com/repos/pamil/Sylius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pamil/Sylius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pamil/Sylius/teams","hooks_url":"https://api.github.com/repos/pamil/Sylius/hooks","issue_events_url":"https://api.github.com/repos/pamil/Sylius/issues/events{/number}","events_url":"https://api.github.com/repos/pamil/Sylius/events","assignees_url":"https://api.github.com/repos/pamil/Sylius/assignees{/user}","branches_url":"https://api.github.com/repos/pamil/Sylius/branches{/branch}","tags_url":"https://api.github.com/repos/pamil/Sylius/tags","blobs_url":"https://api.github.com/repos/pamil/Sylius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pamil/Sylius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pamil/Sylius/git/refs{/sha}","trees_url":"https://api.github.com/repos/pamil/Sylius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pamil/Sylius/statuses/{sha}","languages_url":"https://api.github.com/repos/pamil/Sylius/languages","stargazers_url":"https://api.github.com/repos/pamil/Sylius/stargazers","contributors_url":"https://api.github.com/repos/pamil/Sylius/contributors","subscribers_url":"https://api.github.com/repos/pamil/Sylius/subscribers","subscription_url":"https://api.github.com/repos/pamil/Sylius/subscription","commits_url":"https://api.github.com/repos/pamil/Sylius/commits{/sha}","git_commits_url":"https://api.github.com/repos/pamil/Sylius/git/commits{/sha}","comments_url":"https://api.github.com/repos/pamil/Sylius/comments{/number}","issue_comment_url":"https://api.github.com/repos/pamil/Sylius/issues/comments{/number}","contents_url":"https://api.github.com/repos/pamil/Sylius/contents/{+path}","compare_url":"https://api.github.com/repos/pamil/Sylius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pamil/Sylius/merges","archive_url":"https://api.github.com/repos/pamil/Sylius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pamil/Sylius/downloads","issues_url":"https://api.github.com/repos/pamil/Sylius/issues{/number}","pulls_url":"https://api.github.com/repos/pamil/Sylius/pulls{/number}","milestones_url":"https://api.github.com/repos/pamil/Sylius/milestones{/number}","notifications_url":"https://api.github.com/repos/pamil/Sylius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pamil/Sylius/labels{/name}","releases_url":"https://api.github.com/repos/pamil/Sylius/releases{/id}","deployments_url":"https://api.github.com/repos/pamil/Sylius/deployments","created_at":"2015-04-08T16:39:30Z","updated_at":"2016-01-11T13:14:03Z","pushed_at":"2016-07-26T07:45:24Z","git_url":"git://github.com/pamil/Sylius.git","ssh_url":"git@github.com:pamil/Sylius.git","clone_url":"https://github.com/pamil/Sylius.git","svn_url":"https://github.com/pamil/Sylius","homepage":"Sylius.org","size":39453,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Sylius:master","ref":"master","sha":"825d11df04e6f8326fa0076274b41df8f42cbac3","user":{"login":"Sylius","id":719423,"avatar_url":"https://avatars.githubusercontent.com/u/719423?v=3","gravatar_id":"","url":"https://api.github.com/users/Sylius","html_url":"https://github.com/Sylius","followers_url":"https://api.github.com/users/Sylius/followers","following_url":"https://api.github.com/users/Sylius/following{/other_user}","gists_url":"https://api.github.com/users/Sylius/gists{/gist_id}","starred_url":"https://api.github.com/users/Sylius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sylius/subscriptions","organizations_url":"https://api.github.com/users/Sylius/orgs","repos_url":"https://api.github.com/users/Sylius/repos","events_url":"https://api.github.com/users/Sylius/events{/privacy}","received_events_url":"https://api.github.com/users/Sylius/received_events","type":"Organization","site_admin":false},"repo":{"id":2717549,"name":"Sylius","full_name":"Sylius/Sylius","owner":{"login":"Sylius","id":719423,"avatar_url":"https://avatars.githubusercontent.com/u/719423?v=3","gravatar_id":"","url":"https://api.github.com/users/Sylius","html_url":"https://github.com/Sylius","followers_url":"https://api.github.com/users/Sylius/followers","following_url":"https://api.github.com/users/Sylius/following{/other_user}","gists_url":"https://api.github.com/users/Sylius/gists{/gist_id}","starred_url":"https://api.github.com/users/Sylius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sylius/subscriptions","organizations_url":"https://api.github.com/users/Sylius/orgs","repos_url":"https://api.github.com/users/Sylius/repos","events_url":"https://api.github.com/users/Sylius/events{/privacy}","received_events_url":"https://api.github.com/users/Sylius/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sylius/Sylius","description":"eCommerce PHP framework built on top of Symfony with component-based architecture and format-agnostic rendering. (HTML/JSON/XML)","fork":false,"url":"https://api.github.com/repos/Sylius/Sylius","forks_url":"https://api.github.com/repos/Sylius/Sylius/forks","keys_url":"https://api.github.com/repos/Sylius/Sylius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sylius/Sylius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sylius/Sylius/teams","hooks_url":"https://api.github.com/repos/Sylius/Sylius/hooks","issue_events_url":"https://api.github.com/repos/Sylius/Sylius/issues/events{/number}","events_url":"https://api.github.com/repos/Sylius/Sylius/events","assignees_url":"https://api.github.com/repos/Sylius/Sylius/assignees{/user}","branches_url":"https://api.github.com/repos/Sylius/Sylius/branches{/branch}","tags_url":"https://api.github.com/repos/Sylius/Sylius/tags","blobs_url":"https://api.github.com/repos/Sylius/Sylius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sylius/Sylius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sylius/Sylius/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sylius/Sylius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sylius/Sylius/statuses/{sha}","languages_url":"https://api.github.com/repos/Sylius/Sylius/languages","stargazers_url":"https://api.github.com/repos/Sylius/Sylius/stargazers","contributors_url":"https://api.github.com/repos/Sylius/Sylius/contributors","subscribers_url":"https://api.github.com/repos/Sylius/Sylius/subscribers","subscription_url":"https://api.github.com/repos/Sylius/Sylius/subscription","commits_url":"https://api.github.com/repos/Sylius/Sylius/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sylius/Sylius/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sylius/Sylius/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sylius/Sylius/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sylius/Sylius/contents/{+path}","compare_url":"https://api.github.com/repos/Sylius/Sylius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sylius/Sylius/merges","archive_url":"https://api.github.com/repos/Sylius/Sylius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sylius/Sylius/downloads","issues_url":"https://api.github.com/repos/Sylius/Sylius/issues{/number}","pulls_url":"https://api.github.com/repos/Sylius/Sylius/pulls{/number}","milestones_url":"https://api.github.com/repos/Sylius/Sylius/milestones{/number}","notifications_url":"https://api.github.com/repos/Sylius/Sylius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sylius/Sylius/labels{/name}","releases_url":"https://api.github.com/repos/Sylius/Sylius/releases{/id}","deployments_url":"https://api.github.com/repos/Sylius/Sylius/deployments","created_at":"2011-11-05T22:05:52Z","updated_at":"2016-07-25T16:25:33Z","pushed_at":"2016-07-26T07:52:01Z","git_url":"git://github.com/Sylius/Sylius.git","ssh_url":"git@github.com:Sylius/Sylius.git","clone_url":"https://github.com/Sylius/Sylius.git","svn_url":"https://github.com/Sylius/Sylius","homepage":"http://Sylius.org","size":74628,"stargazers_count":2386,"watchers_count":2386,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":880,"mirror_url":null,"open_issues_count":738,"forks":880,"open_issues":738,"watchers":2386,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/5597"},"html":{"href":"https://github.com/Sylius/Sylius/pull/5597"},"issue":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/5597"},"comments":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/5597/comments"},"review_comments":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/5597/comments"},"review_comment":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/5597/commits"},"statuses":{"href":"https://api.github.com/repos/Sylius/Sylius/statuses/61ae7dfc886eea59b1b16b0b51cb0b146beccd4b"}}}}
{"actor":{"display_login":"pamil"}}