{"action":"created","comment":{"url":"https://api.github.com/repos/cms-dev/cms/pulls/comments/169394947","pull_request_review_id":97914919,"id":169394947,"diff_hunk":"@@ -128,28 +128,28 @@ <h2>{{ _(\"Some details\") }}</h2>\n \n {% if tokens_contest != 0 and tokens_tasks != 0 %}\n <tr>\n-    <th>{{ _(\"Tokens\") }}</th>\n+    <th>{% trans %}Tokens{% endtrans %}</th>\n     <td colspan=\"2\" class=\"token_rules\">\n     {% if tokens_contest == 2 and tokens_tasks == 2 %}\n         <p>\n-        {{ _(\"You have an infinite number of tokens.\") }}\n+        {% trans %}You have an infinite number of tokens.{% endtrans %}\n         </p>\n     {% elif tokens_contest == 2 %}\n         <p>\n         {{ task|extract_token_params|format_token_rules }}\n         </p>\n     {% elif tokens_tasks == 2 %}\n         <p>\n-        {% raw _(\"You can find the rules for the %(type_pl)s on the <a href=\\\"%(contest_root)s\\\">contest overview page</a>.\") % {\"type_pl\": _(\"tokens\"), \"contest_root\": contest_url()} %}\n+        {% trans type_pl=_(\"tokens\"), contest_root=contest_url() %}You can find the rules for the {{ type_pl }} on the <a href=\"{{ contest_root }}\">contest overview page</a>.{% endtrans %}","path":"cms/server/contest/templates/task_description.html","position":138,"original_position":135,"commit_id":"0099d8bdc5cefdb05962d6e966fbaf629ab2ad16","original_commit_id":"d7b2d50823740d8f03a67ca9bf07ed5828a65ee9","user":{"login":"lerks","id":120810,"avatar_url":"https://avatars1.githubusercontent.com/u/120810?v=4","gravatar_id":"","url":"https://api.github.com/users/lerks","html_url":"https://github.com/lerks","followers_url":"https://api.github.com/users/lerks/followers","following_url":"https://api.github.com/users/lerks/following{/other_user}","gists_url":"https://api.github.com/users/lerks/gists{/gist_id}","starred_url":"https://api.github.com/users/lerks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lerks/subscriptions","organizations_url":"https://api.github.com/users/lerks/orgs","repos_url":"https://api.github.com/users/lerks/repos","events_url":"https://api.github.com/users/lerks/events{/privacy}","received_events_url":"https://api.github.com/users/lerks/received_events","type":"User","site_admin":false},"body":"See above.","created_at":"2018-02-20T17:22:30Z","updated_at":"2018-02-20T17:22:30Z","html_url":"https://github.com/cms-dev/cms/pull/846#discussion_r169394947","pull_request_url":"https://api.github.com/repos/cms-dev/cms/pulls/846","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/comments/169394947"},"html":{"href":"https://github.com/cms-dev/cms/pull/846#discussion_r169394947"},"pull_request":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/846"}},"in_reply_to_id":169391829},"pull_request":{"url":"https://api.github.com/repos/cms-dev/cms/pulls/846","id":170212424,"html_url":"https://github.com/cms-dev/cms/pull/846","diff_url":"https://github.com/cms-dev/cms/pull/846.diff","patch_url":"https://github.com/cms-dev/cms/pull/846.patch","issue_url":"https://api.github.com/repos/cms-dev/cms/issues/846","number":846,"state":"open","locked":false,"title":"Continue porting the CWS templates from Tornado to Jinja2","user":{"login":"lerks","id":120810,"avatar_url":"https://avatars1.githubusercontent.com/u/120810?v=4","gravatar_id":"","url":"https://api.github.com/users/lerks","html_url":"https://github.com/lerks","followers_url":"https://api.github.com/users/lerks/followers","following_url":"https://api.github.com/users/lerks/following{/other_user}","gists_url":"https://api.github.com/users/lerks/gists{/gist_id}","starred_url":"https://api.github.com/users/lerks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lerks/subscriptions","organizations_url":"https://api.github.com/users/lerks/orgs","repos_url":"https://api.github.com/users/lerks/repos","events_url":"https://api.github.com/users/lerks/events{/privacy}","received_events_url":"https://api.github.com/users/lerks/received_events","type":"User","site_admin":false},"body":"This is the second of a series of pull requests that ports CWS's templates from the Tornado engine to Jinja2. This pull request improves the way we do localization in the templates.\r\n* Using context-aware filters allows us to reduce the boilerplate for most formatting operations.\r\n* Using the `{% trans %}` blocks allows to better manage the escaping (e.g., no need to disable autoescaping when the message contains HTML) and the parameters injection.\r\n* Finally, since Jinja2 provides a Babel extractor, we can reenable templates in Babel's mapping. The fact that the extractor does in fact perform a complete parsing of the templates, builds an AST and then extracts messages from there makes sure that they are all caught (unlike in Tornado, where xgettext was parsing the templates as if they were Python files and mysteriously missed some messages (it is in fact surprising that it *only* missed a couple)).\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cms-dev/cms/846)\n<!-- Reviewable:end -->\n","created_at":"2018-02-20T14:47:41Z","updated_at":"2018-02-20T17:22:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76e957d87b7bfcc04d535f47ed179f0d84056055","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cms-dev/cms/pulls/846/commits","review_comments_url":"https://api.github.com/repos/cms-dev/cms/pulls/846/comments","review_comment_url":"https://api.github.com/repos/cms-dev/cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cms-dev/cms/issues/846/comments","statuses_url":"https://api.github.com/repos/cms-dev/cms/statuses/0099d8bdc5cefdb05962d6e966fbaf629ab2ad16","head":{"label":"lerks:jinja_next","ref":"jinja_next","sha":"0099d8bdc5cefdb05962d6e966fbaf629ab2ad16","user":{"login":"lerks","id":120810,"avatar_url":"https://avatars1.githubusercontent.com/u/120810?v=4","gravatar_id":"","url":"https://api.github.com/users/lerks","html_url":"https://github.com/lerks","followers_url":"https://api.github.com/users/lerks/followers","following_url":"https://api.github.com/users/lerks/following{/other_user}","gists_url":"https://api.github.com/users/lerks/gists{/gist_id}","starred_url":"https://api.github.com/users/lerks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lerks/subscriptions","organizations_url":"https://api.github.com/users/lerks/orgs","repos_url":"https://api.github.com/users/lerks/repos","events_url":"https://api.github.com/users/lerks/events{/privacy}","received_events_url":"https://api.github.com/users/lerks/received_events","type":"User","site_admin":false},"repo":{"id":6427522,"name":"cms","full_name":"lerks/cms","owner":{"login":"lerks","id":120810,"avatar_url":"https://avatars1.githubusercontent.com/u/120810?v=4","gravatar_id":"","url":"https://api.github.com/users/lerks","html_url":"https://github.com/lerks","followers_url":"https://api.github.com/users/lerks/followers","following_url":"https://api.github.com/users/lerks/following{/other_user}","gists_url":"https://api.github.com/users/lerks/gists{/gist_id}","starred_url":"https://api.github.com/users/lerks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lerks/subscriptions","organizations_url":"https://api.github.com/users/lerks/orgs","repos_url":"https://api.github.com/users/lerks/repos","events_url":"https://api.github.com/users/lerks/events{/privacy}","received_events_url":"https://api.github.com/users/lerks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lerks/cms","description":"Contest Management System","fork":true,"url":"https://api.github.com/repos/lerks/cms","forks_url":"https://api.github.com/repos/lerks/cms/forks","keys_url":"https://api.github.com/repos/lerks/cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lerks/cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lerks/cms/teams","hooks_url":"https://api.github.com/repos/lerks/cms/hooks","issue_events_url":"https://api.github.com/repos/lerks/cms/issues/events{/number}","events_url":"https://api.github.com/repos/lerks/cms/events","assignees_url":"https://api.github.com/repos/lerks/cms/assignees{/user}","branches_url":"https://api.github.com/repos/lerks/cms/branches{/branch}","tags_url":"https://api.github.com/repos/lerks/cms/tags","blobs_url":"https://api.github.com/repos/lerks/cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lerks/cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lerks/cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/lerks/cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lerks/cms/statuses/{sha}","languages_url":"https://api.github.com/repos/lerks/cms/languages","stargazers_url":"https://api.github.com/repos/lerks/cms/stargazers","contributors_url":"https://api.github.com/repos/lerks/cms/contributors","subscribers_url":"https://api.github.com/repos/lerks/cms/subscribers","subscription_url":"https://api.github.com/repos/lerks/cms/subscription","commits_url":"https://api.github.com/repos/lerks/cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/lerks/cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/lerks/cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/lerks/cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/lerks/cms/contents/{+path}","compare_url":"https://api.github.com/repos/lerks/cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lerks/cms/merges","archive_url":"https://api.github.com/repos/lerks/cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lerks/cms/downloads","issues_url":"https://api.github.com/repos/lerks/cms/issues{/number}","pulls_url":"https://api.github.com/repos/lerks/cms/pulls{/number}","milestones_url":"https://api.github.com/repos/lerks/cms/milestones{/number}","notifications_url":"https://api.github.com/repos/lerks/cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lerks/cms/labels{/name}","releases_url":"https://api.github.com/repos/lerks/cms/releases{/id}","deployments_url":"https://api.github.com/repos/lerks/cms/deployments","created_at":"2012-10-28T13:01:06Z","updated_at":"2017-04-05T21:56:44Z","pushed_at":"2018-02-20T14:41:21Z","git_url":"git://github.com/lerks/cms.git","ssh_url":"git@github.com:lerks/cms.git","clone_url":"https://github.com/lerks/cms.git","svn_url":"https://github.com/lerks/cms","homepage":"","size":15390,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cms-dev:jinja","ref":"jinja","sha":"6192c38e8b4b225c97d5fa244942e7d2e877e796","user":{"login":"cms-dev","id":1671612,"avatar_url":"https://avatars0.githubusercontent.com/u/1671612?v=4","gravatar_id":"","url":"https://api.github.com/users/cms-dev","html_url":"https://github.com/cms-dev","followers_url":"https://api.github.com/users/cms-dev/followers","following_url":"https://api.github.com/users/cms-dev/following{/other_user}","gists_url":"https://api.github.com/users/cms-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/cms-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cms-dev/subscriptions","organizations_url":"https://api.github.com/users/cms-dev/orgs","repos_url":"https://api.github.com/users/cms-dev/repos","events_url":"https://api.github.com/users/cms-dev/events{/privacy}","received_events_url":"https://api.github.com/users/cms-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":2504741,"name":"cms","full_name":"cms-dev/cms","owner":{"login":"cms-dev","id":1671612,"avatar_url":"https://avatars0.githubusercontent.com/u/1671612?v=4","gravatar_id":"","url":"https://api.github.com/users/cms-dev","html_url":"https://github.com/cms-dev","followers_url":"https://api.github.com/users/cms-dev/followers","following_url":"https://api.github.com/users/cms-dev/following{/other_user}","gists_url":"https://api.github.com/users/cms-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/cms-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cms-dev/subscriptions","organizations_url":"https://api.github.com/users/cms-dev/orgs","repos_url":"https://api.github.com/users/cms-dev/repos","events_url":"https://api.github.com/users/cms-dev/events{/privacy}","received_events_url":"https://api.github.com/users/cms-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cms-dev/cms","description":"Contest Management System","fork":false,"url":"https://api.github.com/repos/cms-dev/cms","forks_url":"https://api.github.com/repos/cms-dev/cms/forks","keys_url":"https://api.github.com/repos/cms-dev/cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cms-dev/cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cms-dev/cms/teams","hooks_url":"https://api.github.com/repos/cms-dev/cms/hooks","issue_events_url":"https://api.github.com/repos/cms-dev/cms/issues/events{/number}","events_url":"https://api.github.com/repos/cms-dev/cms/events","assignees_url":"https://api.github.com/repos/cms-dev/cms/assignees{/user}","branches_url":"https://api.github.com/repos/cms-dev/cms/branches{/branch}","tags_url":"https://api.github.com/repos/cms-dev/cms/tags","blobs_url":"https://api.github.com/repos/cms-dev/cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cms-dev/cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cms-dev/cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/cms-dev/cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cms-dev/cms/statuses/{sha}","languages_url":"https://api.github.com/repos/cms-dev/cms/languages","stargazers_url":"https://api.github.com/repos/cms-dev/cms/stargazers","contributors_url":"https://api.github.com/repos/cms-dev/cms/contributors","subscribers_url":"https://api.github.com/repos/cms-dev/cms/subscribers","subscription_url":"https://api.github.com/repos/cms-dev/cms/subscription","commits_url":"https://api.github.com/repos/cms-dev/cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/cms-dev/cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/cms-dev/cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/cms-dev/cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/cms-dev/cms/contents/{+path}","compare_url":"https://api.github.com/repos/cms-dev/cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cms-dev/cms/merges","archive_url":"https://api.github.com/repos/cms-dev/cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cms-dev/cms/downloads","issues_url":"https://api.github.com/repos/cms-dev/cms/issues{/number}","pulls_url":"https://api.github.com/repos/cms-dev/cms/pulls{/number}","milestones_url":"https://api.github.com/repos/cms-dev/cms/milestones{/number}","notifications_url":"https://api.github.com/repos/cms-dev/cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cms-dev/cms/labels{/name}","releases_url":"https://api.github.com/repos/cms-dev/cms/releases{/id}","deployments_url":"https://api.github.com/repos/cms-dev/cms/deployments","created_at":"2011-10-03T13:37:02Z","updated_at":"2018-02-19T18:10:22Z","pushed_at":"2018-02-20T14:47:50Z","git_url":"git://github.com/cms-dev/cms.git","ssh_url":"git@github.com:cms-dev/cms.git","clone_url":"https://github.com/cms-dev/cms.git","svn_url":"https://github.com/cms-dev/cms","homepage":"http://cms-dev.github.io/","size":15850,"stargazers_count":372,"watchers_count":372,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":213,"mirror_url":null,"archived":false,"open_issues_count":133,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":213,"open_issues":133,"watchers":372,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/846"},"html":{"href":"https://github.com/cms-dev/cms/pull/846"},"issue":{"href":"https://api.github.com/repos/cms-dev/cms/issues/846"},"comments":{"href":"https://api.github.com/repos/cms-dev/cms/issues/846/comments"},"review_comments":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/846/comments"},"review_comment":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cms-dev/cms/pulls/846/commits"},"statuses":{"href":"https://api.github.com/repos/cms-dev/cms/statuses/0099d8bdc5cefdb05962d6e966fbaf629ab2ad16"}},"author_association":"OWNER"}}
{"actor":{"display_login":"lerks"}}