{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/21110","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/21110/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/21110/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/21110/events","html_url":"https://github.com/symfony/symfony/issues/21110","id":198162300,"number":21110,"title":"Web Profiler logs missing messages when setting the translation domain to false","user":{"login":"tonynelson19","id":210409,"avatar_url":"https://avatars.githubusercontent.com/u/210409?v=3","gravatar_id":"","url":"https://api.github.com/users/tonynelson19","html_url":"https://github.com/tonynelson19","followers_url":"https://api.github.com/users/tonynelson19/followers","following_url":"https://api.github.com/users/tonynelson19/following{/other_user}","gists_url":"https://api.github.com/users/tonynelson19/gists{/gist_id}","starred_url":"https://api.github.com/users/tonynelson19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonynelson19/subscriptions","organizations_url":"https://api.github.com/users/tonynelson19/orgs","repos_url":"https://api.github.com/users/tonynelson19/repos","events_url":"https://api.github.com/users/tonynelson19/events{/privacy}","received_events_url":"https://api.github.com/users/tonynelson19/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-12-30T15:49:00Z","updated_at":"2016-12-31T12:01:59Z","closed_at":null,"body":"| Q                | A\r\n| ---------------- | -----\r\n| Bug report?      | yes\r\n| Feature request? | no\r\n| BC Break report? |no\r\n| RFC?             | no\r\n| Symfony version  | 3.2.1\r\n\r\nIf you use a `false` translation domain to disable a translation, the web profiler displays the string as missing a translation. This commonly happens inside forms when using the `translation_domain` and `choices_translation_domain` options, but can also happen when translating directly inside Twig.\r\n\r\nThe following can recreate the issue on a new Symfony project.\r\n\r\n```php\r\n{{ \"Hello World!\"|trans({}, false) }}\r\n```\r\n![profiler](https://cloud.githubusercontent.com/assets/210409/21567787/9006e85a-ce74-11e6-8337-d6a66e0b639a.png)\r\n\r\n![translation-messages](https://cloud.githubusercontent.com/assets/210409/21567802/b19a90fc-ce74-11e6-866b-3c47a6f00324.png)\r\n\r\n![log-messages](https://cloud.githubusercontent.com/assets/210409/21567800/ac605a22-ce74-11e6-8852-9f4fd897b8c4.png)\r\n\r\nThis can be fixed by adding the following condition to the top of [`DataCollectorTranslator::collectMessage`](https://github.com/symfony/translation/blob/master/DataCollectorTranslator.php#L131) to prevent the web profiler from collecting the disabled translation.\r\n\r\n```php\r\nif (false === $domain) {\r\n    return;\r\n}\r\n```\r\n\r\nThe same fix can be added to the top of [`LoggingTranslator::log`](https://github.com/symfony/translation/blob/master/LoggingTranslator.php#L121) to prevent a \"Translation not found.\" warning from be logged."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/269862036","html_url":"https://github.com/symfony/symfony/issues/21110#issuecomment-269862036","issue_url":"https://api.github.com/repos/symfony/symfony/issues/21110","id":269862036,"user":{"login":"tonynelson19","id":210409,"avatar_url":"https://avatars.githubusercontent.com/u/210409?v=3","gravatar_id":"","url":"https://api.github.com/users/tonynelson19","html_url":"https://github.com/tonynelson19","followers_url":"https://api.github.com/users/tonynelson19/followers","following_url":"https://api.github.com/users/tonynelson19/following{/other_user}","gists_url":"https://api.github.com/users/tonynelson19/gists{/gist_id}","starred_url":"https://api.github.com/users/tonynelson19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonynelson19/subscriptions","organizations_url":"https://api.github.com/users/tonynelson19/orgs","repos_url":"https://api.github.com/users/tonynelson19/repos","events_url":"https://api.github.com/users/tonynelson19/events{/privacy}","received_events_url":"https://api.github.com/users/tonynelson19/received_events","type":"User","site_admin":false},"created_at":"2016-12-31T12:01:59Z","updated_at":"2016-12-31T12:01:59Z","body":"How exactly is it a BC break?"}}
{"actor":{"display_login":"tonynelson19"}}