{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/43408557","id":43408557,"diff_hunk":"@@ -1,3 +1,8 @@\n <h4 class=\"video-detail-name\"><%- fileName %></h4>\n <progress class=\"video-detail-progress\" value=\"<%= progress %>\"></progress>\n-<p class=\"video-detail-status\"><%- gettext(status) %></p>\n+<p class=\"video-detail-status\">\n+  <%- gettext(","path":"cms/templates/js/active-video-upload.underscore","position":5,"original_position":5,"commit_id":"ffc99404643259c5dd0982018e63ae6236a3a9c1","original_commit_id":"ffc99404643259c5dd0982018e63ae6236a3a9c1","user":{"login":"louyihua","id":1275238,"avatar_url":"https://avatars.githubusercontent.com/u/1275238?v=3","gravatar_id":"","url":"https://api.github.com/users/louyihua","html_url":"https://github.com/louyihua","followers_url":"https://api.github.com/users/louyihua/followers","following_url":"https://api.github.com/users/louyihua/following{/other_user}","gists_url":"https://api.github.com/users/louyihua/gists{/gist_id}","starred_url":"https://api.github.com/users/louyihua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/louyihua/subscriptions","organizations_url":"https://api.github.com/users/louyihua/orgs","repos_url":"https://api.github.com/users/louyihua/repos","events_url":"https://api.github.com/users/louyihua/events{/privacy}","received_events_url":"https://api.github.com/users/louyihua/received_events","type":"User","site_admin":false},"body":"Here, this is a varible name, not a string literal that need to be extracted. But the library does not distinguish them and it will extract anything that looks like a string at the position of first argument. So separate them into two lines will make the the varible name 'status' not be mistakenly extracted.","created_at":"2015-10-29T16:26:24Z","updated_at":"2015-10-29T16:26:24Z","html_url":"https://github.com/edx/edx-platform/pull/10416#discussion_r43408557","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/10416","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/43408557"},"html":{"href":"https://github.com/edx/edx-platform/pull/10416#discussion_r43408557"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10416"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/10416","id":49107230,"html_url":"https://github.com/edx/edx-platform/pull/10416","diff_url":"https://github.com/edx/edx-platform/pull/10416.diff","patch_url":"https://github.com/edx/edx-platform/pull/10416.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/10416","number":10416,"state":"open","locked":false,"title":"Fix underscore extraction error","user":{"login":"louyihua","id":1275238,"avatar_url":"https://avatars.githubusercontent.com/u/1275238?v=3","gravatar_id":"","url":"https://api.github.com/users/louyihua","html_url":"https://github.com/louyihua","followers_url":"https://api.github.com/users/louyihua/followers","following_url":"https://api.github.com/users/louyihua/following{/other_user}","gists_url":"https://api.github.com/users/louyihua/gists{/gist_id}","starred_url":"https://api.github.com/users/louyihua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/louyihua/subscriptions","organizations_url":"https://api.github.com/users/louyihua/orgs","repos_url":"https://api.github.com/users/louyihua/repos","events_url":"https://api.github.com/users/louyihua/events{/privacy}","received_events_url":"https://api.github.com/users/louyihua/received_events","type":"User","site_admin":false},"body":"The underscore extraction library has two bugs (limitations):\r\n\r\n1. It requires strings and function names (one of ```gettext```, ```ngettext``` and ```interpolate```) to be in the same line for proper extraction.\r\nFor example, in the following line, the string \"text extracted\" is correctly extracted:\r\n```gettext(\"text extracted\")```\r\nHowever, in the following line, the string \"text can't be extracted\" can not be extracted:\r\n```gettext(\"text can't be extracted\")```\r\n\r\n2. It always extract the first argument of ```gettext``` and ```interpolate```, and the first two arguments of ```ngettext```, regardless of whether it is a string literal (that should be extracted) or it is a varible name (that should not be extracted).\r\nFor example, in the following line, the varible name ```fmt``` is mistakenly extracted:\r\n```interpolate(fmt, params, true)```\r\n\r\nNow the two bugs affects edx-platform in the following ways:\r\n1. Some strings are not extracted, as they are not in the same line with the function name.\r\n2. Some varible names are  mistakenly extracted, as they are in the same line with the function name.\r\n\r\nTo solve such problems, some rules should be applied:\r\n1. String literals should always be in the same line with the function name (one of ```gettext```, ```ngettext``` and ```interpolate```), even if it will produce a very long line. Fail to do so will cause the string not be extracted or only partially extracted.\r\n2. Varible names must not be in the same line with the function name (one of ```gettext```, ```ngettext``` and ```interpolate```), even if it is a very simple case like ```gettext(message)```. Fail to do so will cause the varible name be mistakenly extracted.\r\n\r\nThis PR fixes the existing problem in underscore files. And I've also submitted a note for this in the developer's documentation (https://github.com/edx/edx-documentation/pull/654).\r\n","created_at":"2015-10-29T07:44:31Z","updated_at":"2015-10-29T16:26:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6573e7ac81bf33676cc989f1de6ea46b2199554","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/10416/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/10416/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/10416/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/ffc99404643259c5dd0982018e63ae6236a3a9c1","head":{"label":"louyihua:underscore_ngettext","ref":"underscore_ngettext","sha":"ffc99404643259c5dd0982018e63ae6236a3a9c1","user":{"login":"louyihua","id":1275238,"avatar_url":"https://avatars.githubusercontent.com/u/1275238?v=3","gravatar_id":"","url":"https://api.github.com/users/louyihua","html_url":"https://github.com/louyihua","followers_url":"https://api.github.com/users/louyihua/followers","following_url":"https://api.github.com/users/louyihua/following{/other_user}","gists_url":"https://api.github.com/users/louyihua/gists{/gist_id}","starred_url":"https://api.github.com/users/louyihua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/louyihua/subscriptions","organizations_url":"https://api.github.com/users/louyihua/orgs","repos_url":"https://api.github.com/users/louyihua/repos","events_url":"https://api.github.com/users/louyihua/events{/privacy}","received_events_url":"https://api.github.com/users/louyihua/received_events","type":"User","site_admin":false},"repo":{"id":15471028,"name":"edx-platform","full_name":"louyihua/edx-platform","owner":{"login":"louyihua","id":1275238,"avatar_url":"https://avatars.githubusercontent.com/u/1275238?v=3","gravatar_id":"","url":"https://api.github.com/users/louyihua","html_url":"https://github.com/louyihua","followers_url":"https://api.github.com/users/louyihua/followers","following_url":"https://api.github.com/users/louyihua/following{/other_user}","gists_url":"https://api.github.com/users/louyihua/gists{/gist_id}","starred_url":"https://api.github.com/users/louyihua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/louyihua/subscriptions","organizations_url":"https://api.github.com/users/louyihua/orgs","repos_url":"https://api.github.com/users/louyihua/repos","events_url":"https://api.github.com/users/louyihua/events{/privacy}","received_events_url":"https://api.github.com/users/louyihua/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/louyihua/edx-platform","description":"the edX learning management system (LMS) and course authoring tool, Studio","fork":true,"url":"https://api.github.com/repos/louyihua/edx-platform","forks_url":"https://api.github.com/repos/louyihua/edx-platform/forks","keys_url":"https://api.github.com/repos/louyihua/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/louyihua/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/louyihua/edx-platform/teams","hooks_url":"https://api.github.com/repos/louyihua/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/louyihua/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/louyihua/edx-platform/events","assignees_url":"https://api.github.com/repos/louyihua/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/louyihua/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/louyihua/edx-platform/tags","blobs_url":"https://api.github.com/repos/louyihua/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/louyihua/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/louyihua/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/louyihua/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/louyihua/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/louyihua/edx-platform/languages","stargazers_url":"https://api.github.com/repos/louyihua/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/louyihua/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/louyihua/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/louyihua/edx-platform/subscription","commits_url":"https://api.github.com/repos/louyihua/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/louyihua/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/louyihua/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/louyihua/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/louyihua/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/louyihua/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/louyihua/edx-platform/merges","archive_url":"https://api.github.com/repos/louyihua/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/louyihua/edx-platform/downloads","issues_url":"https://api.github.com/repos/louyihua/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/louyihua/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/louyihua/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/louyihua/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/louyihua/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/louyihua/edx-platform/releases{/id}","created_at":"2013-12-27T09:38:40Z","updated_at":"2015-04-07T05:09:39Z","pushed_at":"2015-10-29T11:25:05Z","git_url":"git://github.com/louyihua/edx-platform.git","ssh_url":"git@github.com:louyihua/edx-platform.git","clone_url":"https://github.com/louyihua/edx-platform.git","svn_url":"https://github.com/louyihua/edx-platform","homepage":"http://code.edx.org/","size":524811,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"d9751a855ac78510933d041f99e1cdce9366cfb3","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-10-29T15:33:12Z","pushed_at":"2015-10-29T16:21:57Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":2202758,"stargazers_count":2202,"watchers_count":2202,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1342,"mirror_url":null,"open_issues_count":166,"forks":1342,"open_issues":166,"watchers":2202,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10416"},"html":{"href":"https://github.com/edx/edx-platform/pull/10416"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10416"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10416/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10416/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10416/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/ffc99404643259c5dd0982018e63ae6236a3a9c1"}}}}