{"action":"created","comment":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/25419426","id":25419426,"diff_hunk":"@@ -0,0 +1,39 @@\n+<?php\n+\n+/*\n+ * This file is part of the Sylius package.\n+ *\n+ * (c) Paweł Jędrzejewski\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Sylius\\Component\\Translation\\Provider;\n+\n+/**\n+ * @author Paweł Jędrzejewski <pawel@sylius.org>\n+ */\n+class CurrentLocaleProvider implements CurrentLocaleProviderInterface","path":"src/Sylius/Component/Translation/Provider/CurrentLocaleProvider.php","position":17,"original_position":17,"commit_id":"02731197c5eabaf88c024bd0cd3e3d970847dd5e","original_commit_id":"02731197c5eabaf88c024bd0cd3e3d970847dd5e","user":{"login":"stloyd","id":67402,"avatar_url":"https://avatars.githubusercontent.com/u/67402?v=3","gravatar_id":"","url":"https://api.github.com/users/stloyd","html_url":"https://github.com/stloyd","followers_url":"https://api.github.com/users/stloyd/followers","following_url":"https://api.github.com/users/stloyd/following{/other_user}","gists_url":"https://api.github.com/users/stloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/stloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stloyd/subscriptions","organizations_url":"https://api.github.com/users/stloyd/orgs","repos_url":"https://api.github.com/users/stloyd/repos","events_url":"https://api.github.com/users/stloyd/events{/privacy}","received_events_url":"https://api.github.com/users/stloyd/received_events","type":"User","site_admin":false},"body":"That `current` sounds a bit strange IMO.","created_at":"2015-02-26T11:10:47Z","updated_at":"2015-02-26T11:10:47Z","html_url":"https://github.com/Sylius/Sylius/pull/2519#discussion_r25419426","pull_request_url":"https://api.github.com/repos/Sylius/Sylius/pulls/2519","_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments/25419426"},"html":{"href":"https://github.com/Sylius/Sylius/pull/2519#discussion_r25419426"},"pull_request":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/2519"}}},"pull_request":{"url":"https://api.github.com/repos/Sylius/Sylius/pulls/2519","id":30059781,"html_url":"https://github.com/Sylius/Sylius/pull/2519","diff_url":"https://github.com/Sylius/Sylius/pull/2519.diff","patch_url":"https://github.com/Sylius/Sylius/pull/2519.patch","issue_url":"https://api.github.com/repos/Sylius/Sylius/issues/2519","number":2519,"state":"open","locked":false,"title":"Rework translations handling","user":{"login":"pjedrzejewski","id":614970,"avatar_url":"https://avatars.githubusercontent.com/u/614970?v=3","gravatar_id":"","url":"https://api.github.com/users/pjedrzejewski","html_url":"https://github.com/pjedrzejewski","followers_url":"https://api.github.com/users/pjedrzejewski/followers","following_url":"https://api.github.com/users/pjedrzejewski/following{/other_user}","gists_url":"https://api.github.com/users/pjedrzejewski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjedrzejewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjedrzejewski/subscriptions","organizations_url":"https://api.github.com/users/pjedrzejewski/orgs","repos_url":"https://api.github.com/users/pjedrzejewski/repos","events_url":"https://api.github.com/users/pjedrzejewski/events{/privacy}","received_events_url":"https://api.github.com/users/pjedrzejewski/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| Deprecations? | no\r\n| Fixed tickets | #2491 #2447 \r\n| License       | MIT\r\n\r\nHey folks!\r\n\r\nThis PR decouples ResourceBundle from TranslationBundle, keeping them standalone.\r\n\r\nBasically, TranslationBundle becomes an extension of ResourceBundle, which you can install if you want to translate your resources.\r\n\r\nAlso, it cleans up the configuration a bit, before:\r\n\r\n``` yaml\r\nsylius_product:\r\n    driver: doctrine/orm\r\n    classes:\r\n        product:\r\n            model: Your\\Product\r\n            controller: Your\\ProductController\r\n            repository: Your\\ProductRepository\r\n            form:\r\n                default: Your\\ProductType\r\n            translatable:\r\n                targetEntity: Your\\ProductTranslation\r\n                translatable_fields: [name, banana]\r\n        product_translation:\r\n            model: Your\\ProductTranslation\r\n            controller: ~\r\n            repository: ~\r\n            form:\r\n                default: Your\\ProductTranslationType\r\n```\r\n\r\nAfter:\r\n\r\n``` yaml\r\nsylius_product:\r\n    driver: doctrine/orm\r\n    classes:\r\n        product:\r\n            model: Your\\Product\r\n            controller: Your\\ProductController\r\n            repository: Your\\ProductRepository\r\n            form:\r\n                default: Your\\ProductType\r\n            translation:\r\n                model: Your\\ProductTranslation\r\n                controller: ~\r\n                repository: ~\r\n                form:\r\n                    default: Your\\ProductTranslationType\r\n                mapping:\r\n                    fields: [name, banana]\r\n```\r\n\r\nSyliusResourceBundle will automatically map this to 2 resources: ``sylius.product`` and ``sylius.product_translation``. Translation has all the perks as normal resource.\r\nIf you do not have SyliusTranslationBundle registered, it will simply ignore this configuration. The circular dependency has been removed:\r\n\r\nSyliusResourceBundle requires Resource\r\nTranslation requires Resource\r\nSyliusTranslationBundle requires SyliusResourceBundle and Translation\r\n\r\nI have also dropped the dependency on ``locale.context``, now TranslationBundle has its own LocaleProvider, which can have different implementations:\r\n\r\nIn Translation component - Return hardcoded locale\r\nIn TranslationBundle - Return locale from current request\r\nIn CoreBundle - Get locale from ``locale.context``\r\n\r\nThings left to do:\r\n\r\n* [ ] Make all scenarios green\r\n* [ ] Fix few specs\r\n* [ ] Allow same thing in SyliusResourceBundle ``resources`` configuration\r\n* [ ] Rename CurrentLocaleProviderInterface to LocaleProviderInterface\r\n* [ ] Update MongoDB driver\r\n\r\nFeedback appreciated!","created_at":"2015-02-26T08:54:15Z","updated_at":"2015-02-26T11:10:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cae3e04177e1599d5c5560cc01742320a218e3d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Sylius/Sylius/pulls/2519/commits","review_comments_url":"https://api.github.com/repos/Sylius/Sylius/pulls/2519/comments","review_comment_url":"https://api.github.com/repos/Sylius/Sylius/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/2519/comments","statuses_url":"https://api.github.com/repos/Sylius/Sylius/statuses/02731197c5eabaf88c024bd0cd3e3d970847dd5e","head":{"label":"pjedrzejewski:decoupling-translations","ref":"decoupling-translations","sha":"02731197c5eabaf88c024bd0cd3e3d970847dd5e","user":{"login":"pjedrzejewski","id":614970,"avatar_url":"https://avatars.githubusercontent.com/u/614970?v=3","gravatar_id":"","url":"https://api.github.com/users/pjedrzejewski","html_url":"https://github.com/pjedrzejewski","followers_url":"https://api.github.com/users/pjedrzejewski/followers","following_url":"https://api.github.com/users/pjedrzejewski/following{/other_user}","gists_url":"https://api.github.com/users/pjedrzejewski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjedrzejewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjedrzejewski/subscriptions","organizations_url":"https://api.github.com/users/pjedrzejewski/orgs","repos_url":"https://api.github.com/users/pjedrzejewski/repos","events_url":"https://api.github.com/users/pjedrzejewski/events{/privacy}","received_events_url":"https://api.github.com/users/pjedrzejewski/received_events","type":"User","site_admin":false},"repo":{"id":14465495,"name":"Sylius","full_name":"pjedrzejewski/Sylius","owner":{"login":"pjedrzejewski","id":614970,"avatar_url":"https://avatars.githubusercontent.com/u/614970?v=3","gravatar_id":"","url":"https://api.github.com/users/pjedrzejewski","html_url":"https://github.com/pjedrzejewski","followers_url":"https://api.github.com/users/pjedrzejewski/followers","following_url":"https://api.github.com/users/pjedrzejewski/following{/other_user}","gists_url":"https://api.github.com/users/pjedrzejewski/gists{/gist_id}","starred_url":"https://api.github.com/users/pjedrzejewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjedrzejewski/subscriptions","organizations_url":"https://api.github.com/users/pjedrzejewski/orgs","repos_url":"https://api.github.com/users/pjedrzejewski/repos","events_url":"https://api.github.com/users/pjedrzejewski/events{/privacy}","received_events_url":"https://api.github.com/users/pjedrzejewski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pjedrzejewski/Sylius","description":"Modern e-commerce for PHP, based on the Symfony2 framework.","fork":true,"url":"https://api.github.com/repos/pjedrzejewski/Sylius","forks_url":"https://api.github.com/repos/pjedrzejewski/Sylius/forks","keys_url":"https://api.github.com/repos/pjedrzejewski/Sylius/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pjedrzejewski/Sylius/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pjedrzejewski/Sylius/teams","hooks_url":"https://api.github.com/repos/pjedrzejewski/Sylius/hooks","issue_events_url":"https://api.github.com/repos/pjedrzejewski/Sylius/issues/events{/number}","events_url":"https://api.github.com/repos/pjedrzejewski/Sylius/events","assignees_url":"https://api.github.com/repos/pjedrzejewski/Sylius/assignees{/user}","branches_url":"https://api.github.com/repos/pjedrzejewski/Sylius/branches{/branch}","tags_url":"https://api.github.com/repos/pjedrzejewski/Sylius/tags","blobs_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/refs{/sha}","trees_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pjedrzejewski/Sylius/statuses/{sha}","languages_url":"https://api.github.com/repos/pjedrzejewski/Sylius/languages","stargazers_url":"https://api.github.com/repos/pjedrzejewski/Sylius/stargazers","contributors_url":"https://api.github.com/repos/pjedrzejewski/Sylius/contributors","subscribers_url":"https://api.github.com/repos/pjedrzejewski/Sylius/subscribers","subscription_url":"https://api.github.com/repos/pjedrzejewski/Sylius/subscription","commits_url":"https://api.github.com/repos/pjedrzejewski/Sylius/commits{/sha}","git_commits_url":"https://api.github.com/repos/pjedrzejewski/Sylius/git/commits{/sha}","comments_url":"https://api.github.com/repos/pjedrzejewski/Sylius/comments{/number}","issue_comment_url":"https://api.github.com/repos/pjedrzejewski/Sylius/issues/comments{/number}","contents_url":"https://api.github.com/repos/pjedrzejewski/Sylius/contents/{+path}","compare_url":"https://api.github.com/repos/pjedrzejewski/Sylius/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pjedrzejewski/Sylius/merges","archive_url":"https://api.github.com/repos/pjedrzejewski/Sylius/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pjedrzejewski/Sylius/downloads","issues_url":"https://api.github.com/repos/pjedrzejewski/Sylius/issues{/number}","pulls_url":"https://api.github.com/repos/pjedrzejewski/Sylius/pulls{/number}","milestones_url":"https://api.github.com/repos/pjedrzejewski/Sylius/milestones{/number}","notifications_url":"https://api.github.com/repos/pjedrzejewski/Sylius/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pjedrzejewski/Sylius/labels{/name}","releases_url":"https://api.github.com/repos/pjedrzejewski/Sylius/releases{/id}","created_at":"2013-11-17T11:15:26Z","updated_at":"2015-02-05T20:06:00Z","pushed_at":"2015-02-26T08:56:05Z","git_url":"git://github.com/pjedrzejewski/Sylius.git","ssh_url":"git@github.com:pjedrzejewski/Sylius.git","clone_url":"https://github.com/pjedrzejewski/Sylius.git","svn_url":"https://github.com/pjedrzejewski/Sylius","homepage":"Sylius.org","size":18379,"stargazers_count":7,"watchers_count":7,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":7,"default_branch":"master"}},"base":{"label":"Sylius:master","ref":"master","sha":"6674d0009a663eac3deef1027421983079c03cab","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":"Modern e-commerce for PHP, based on the Symfony2 framework.","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}","created_at":"2011-11-05T22:05:52Z","updated_at":"2015-02-26T10:50:54Z","pushed_at":"2015-02-25T08:12:34Z","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":"Sylius.org","size":42689,"stargazers_count":1636,"watchers_count":1636,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":550,"mirror_url":null,"open_issues_count":386,"forks":550,"open_issues":386,"watchers":1636,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/2519"},"html":{"href":"https://github.com/Sylius/Sylius/pull/2519"},"issue":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/2519"},"comments":{"href":"https://api.github.com/repos/Sylius/Sylius/issues/2519/comments"},"review_comments":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/2519/comments"},"review_comment":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sylius/Sylius/pulls/2519/commits"},"statuses":{"href":"https://api.github.com/repos/Sylius/Sylius/statuses/02731197c5eabaf88c024bd0cd3e3d970847dd5e"}}}}