{"action":"created","issue":{"url":"https://api.github.com/repos/nijel/weblate/issues/875","repository_url":"https://api.github.com/repos/nijel/weblate","labels_url":"https://api.github.com/repos/nijel/weblate/issues/875/labels{/name}","comments_url":"https://api.github.com/repos/nijel/weblate/issues/875/comments","events_url":"https://api.github.com/repos/nijel/weblate/issues/875/events","html_url":"https://github.com/nijel/weblate/issues/875","id":111391536,"number":875,"title":"validate po file before commit/push","user":{"login":"stanislav-brabec","id":4060584,"avatar_url":"https://avatars.githubusercontent.com/u/4060584?v=3","gravatar_id":"","url":"https://api.github.com/users/stanislav-brabec","html_url":"https://github.com/stanislav-brabec","followers_url":"https://api.github.com/users/stanislav-brabec/followers","following_url":"https://api.github.com/users/stanislav-brabec/following{/other_user}","gists_url":"https://api.github.com/users/stanislav-brabec/gists{/gist_id}","starred_url":"https://api.github.com/users/stanislav-brabec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanislav-brabec/subscriptions","organizations_url":"https://api.github.com/users/stanislav-brabec/orgs","repos_url":"https://api.github.com/users/stanislav-brabec/repos","events_url":"https://api.github.com/users/stanislav-brabec/events{/privacy}","received_events_url":"https://api.github.com/users/stanislav-brabec/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nijel/weblate/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/nijel/weblate/labels/undecided","name":"undecided","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-14T12:52:22Z","updated_at":"2016-03-02T16:09:09Z","closed_at":null,"body":"Weblate checks po files for some errors, reports them to the user, but it allows to ignore some of them.\r\n\r\nIf would be nice to mark checks that cause error in \"msgfmt -c\" as fatal, both in web interface and file upload.\r\n\r\nOtherwise translator can easily break automated build process of the package.\r\n\r\nDeveloper then must solve it in a way that is not friendly to thanslators: e. g. remove the file from the GIT repository.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27403542-validate-po-file-before-commit-push?utm_campaign=plugin&utm_content=tracker%2F253393&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F253393&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/nijel/weblate/issues/comments/191305643","html_url":"https://github.com/nijel/weblate/issues/875#issuecomment-191305643","issue_url":"https://api.github.com/repos/nijel/weblate/issues/875","id":191305643,"user":{"login":"aplanas","id":645701,"avatar_url":"https://avatars.githubusercontent.com/u/645701?v=3","gravatar_id":"","url":"https://api.github.com/users/aplanas","html_url":"https://github.com/aplanas","followers_url":"https://api.github.com/users/aplanas/followers","following_url":"https://api.github.com/users/aplanas/following{/other_user}","gists_url":"https://api.github.com/users/aplanas/gists{/gist_id}","starred_url":"https://api.github.com/users/aplanas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aplanas/subscriptions","organizations_url":"https://api.github.com/users/aplanas/orgs","repos_url":"https://api.github.com/users/aplanas/repos","events_url":"https://api.github.com/users/aplanas/events{/privacy}","received_events_url":"https://api.github.com/users/aplanas/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T16:09:09Z","updated_at":"2016-03-02T16:09:09Z","body":"AFAIS there are three elements in this issue:\r\n\r\n1. Add an extra `msgfmt -c` check (some `weblate.trans.checks.format.MsgFmtCheck` class, disabled by default\r\n2. Detect the placeholder bug (`%2$s` as `%2$X`)\r\n3. Disable push if the PO still contains errors where `severity == 'danger'`\r\n\r\nThe feature in 2. looks like that is currently implemented in one of the `XXXFormatCheck` class, and is working in my local examples.\r\n\r\nThe feature 1 is a bit dangerous: on one side there is overlapping with 2, and `msgfmt -c` do not usually categorize the errors, even enumerate the total number of fatal errors. I guess that this can be fixed with some heuristics. Not sure that to do with the overlapping cases.\r\n\r\n3 can make sense, but again we have 2, we forbid the push / upload from errors in the local checkers, or only for the ones found in msgfmt?"}}