{"action":"created","issue":{"url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/397","labels_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/397/labels{/name}","comments_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/397/comments","events_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/397/events","html_url":"https://github.com/sensiolabs/SensioFrameworkExtraBundle/issues/397","id":129790723,"number":397,"title":"any way to configure global optional _locale?","user":{"login":"jurchiks","id":542788,"avatar_url":"https://avatars.githubusercontent.com/u/542788?v=3","gravatar_id":"","url":"https://api.github.com/users/jurchiks","html_url":"https://github.com/jurchiks","followers_url":"https://api.github.com/users/jurchiks/followers","following_url":"https://api.github.com/users/jurchiks/following{/other_user}","gists_url":"https://api.github.com/users/jurchiks/gists{/gist_id}","starred_url":"https://api.github.com/users/jurchiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jurchiks/subscriptions","organizations_url":"https://api.github.com/users/jurchiks/orgs","repos_url":"https://api.github.com/users/jurchiks/repos","events_url":"https://api.github.com/users/jurchiks/events{/privacy}","received_events_url":"https://api.github.com/users/jurchiks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2016-01-29T15:04:35Z","updated_at":"2016-01-31T21:37:25Z","closed_at":null,"body":"Currently, all actions in all my controllers are annotated like this:\r\n```\r\n    /**\r\n     * @Route(\"/\")\r\n     * @Route(\"/{_locale}/\", name=\"homepage\", requirements={\"_locale\"=\"%allowed_locales%\"})\r\n     */\r\n    public function indexAction(Request $request)\r\n...\r\n    /**\r\n     * @Route(\"/vip/\")\r\n     * @Route(\"/{_locale}/vip/\", name=\"vip\", requirements={\"_locale\"=\"%allowed_locales%\"})\r\n     */\r\n    public function vipAction(Request $request)\r\n...\r\n    /**\r\n     * @Route(\"/hotel/\")\r\n     * @Route(\"/{_locale}/hotel/\", name=\"hotel\", requirements={\"_locale\"=\"%allowed_locales%\"})\r\n     */\r\n    public function hotelAction(Request $request)\r\n...\r\n```\r\nObviously, this is not DRY. I have tried searching for a solution, including creating a stackoverflow question, but have not found a fix yet. Is there any way to put this optional _locale in a config somewhere to avoid copying it on every action?\r\n\r\nThis really feels like it should be a built-in feature."},"comment":{"url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/comments/177621657","html_url":"https://github.com/sensiolabs/SensioFrameworkExtraBundle/issues/397#issuecomment-177621657","issue_url":"https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/issues/397","id":177621657,"user":{"login":"Ener-Getick","id":6871899,"avatar_url":"https://avatars.githubusercontent.com/u/6871899?v=3","gravatar_id":"","url":"https://api.github.com/users/Ener-Getick","html_url":"https://github.com/Ener-Getick","followers_url":"https://api.github.com/users/Ener-Getick/followers","following_url":"https://api.github.com/users/Ener-Getick/following{/other_user}","gists_url":"https://api.github.com/users/Ener-Getick/gists{/gist_id}","starred_url":"https://api.github.com/users/Ener-Getick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ener-Getick/subscriptions","organizations_url":"https://api.github.com/users/Ener-Getick/orgs","repos_url":"https://api.github.com/users/Ener-Getick/repos","events_url":"https://api.github.com/users/Ener-Getick/events{/privacy}","received_events_url":"https://api.github.com/users/Ener-Getick/received_events","type":"User","site_admin":false},"created_at":"2016-01-31T21:37:25Z","updated_at":"2016-01-31T21:37:25Z","body":"Unfortunately, I don't think this is doable easily with the current implementation..."}}