{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/27393743","id":27393743,"diff_hunk":"@@ -1,3 +1,14 @@\n+<% \n+    problem_names = [\"Blank Common Problem\", \"Blank Advanced Problem\", \n+        \"Custom Javascript Display and Grading\", \"Custom Python-Evaluated Input\", \n+        \"Drag and Drop\", \"Molecular Structure\", \"Problem with Adaptive Hint\"] ","path":"cms/templates/js/add-xblock-component-menu-problem.underscore","position":4,"original_position":4,"commit_id":"2194e061f35042d4b6eef570db71975fb5e7c4e6","original_commit_id":"2194e061f35042d4b6eef570db71975fb5e7c4e6","user":{"login":"sarina","id":1985317,"avatar_url":"https://avatars.githubusercontent.com/u/1985317?v=3","gravatar_id":"","url":"https://api.github.com/users/sarina","html_url":"https://github.com/sarina","followers_url":"https://api.github.com/users/sarina/followers","following_url":"https://api.github.com/users/sarina/following{/other_user}","gists_url":"https://api.github.com/users/sarina/gists{/gist_id}","starred_url":"https://api.github.com/users/sarina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarina/subscriptions","organizations_url":"https://api.github.com/users/sarina/orgs","repos_url":"https://api.github.com/users/sarina/repos","events_url":"https://api.github.com/users/sarina/events{/privacy}","received_events_url":"https://api.github.com/users/sarina/received_events","type":"User","site_admin":false},"body":"Please see my comment on [TNL-1296](https://openedx.atlassian.net/browse/TNL-1296)","created_at":"2015-03-30T14:22:14Z","updated_at":"2015-03-30T14:22:14Z","html_url":"https://github.com/edx/edx-platform/pull/7512#discussion_r27393743","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/7512","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/27393743"},"html":{"href":"https://github.com/edx/edx-platform/pull/7512#discussion_r27393743"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7512"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/7512","id":32193860,"html_url":"https://github.com/edx/edx-platform/pull/7512","diff_url":"https://github.com/edx/edx-platform/pull/7512.diff","patch_url":"https://github.com/edx/edx-platform/pull/7512.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/7512","number":7512,"state":"open","locked":false,"title":"Fixed i18n Problem with xBlock Menu","user":{"login":"johnespinosa","id":2852075,"avatar_url":"https://avatars.githubusercontent.com/u/2852075?v=3","gravatar_id":"","url":"https://api.github.com/users/johnespinosa","html_url":"https://github.com/johnespinosa","followers_url":"https://api.github.com/users/johnespinosa/followers","following_url":"https://api.github.com/users/johnespinosa/following{/other_user}","gists_url":"https://api.github.com/users/johnespinosa/gists{/gist_id}","starred_url":"https://api.github.com/users/johnespinosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnespinosa/subscriptions","organizations_url":"https://api.github.com/users/johnespinosa/orgs","repos_url":"https://api.github.com/users/johnespinosa/repos","events_url":"https://api.github.com/users/johnespinosa/events{/privacy}","received_events_url":"https://api.github.com/users/johnespinosa/received_events","type":"User","site_admin":false},"body":"\r\n![screen shot 2015-03-30 at 1 42 37 am](https://cloud.githubusercontent.com/assets/2852075/6889265/0fa5415a-d693-11e4-8a8f-aec37ef57c0b.png)\r\n![screen shot 2015-03-30 at 2 00 20 am](https://cloud.githubusercontent.com/assets/2852075/6889266/1b682174-d693-11e4-9100-04e0ec537d28.png)\r\n\r\nAddressed bug in the following issue:\r\nhttps://openedx.atlassian.net/browse/TNL-1296\r\n\r\nThere were strings that were not i18n in the xblock problem menu. The fix I made seems a little hacky. The yaml files controlled what the titles ended up being in menu. Since yaml has no i18n capabilities, and since mako does not allow for hashtables (unless they are introduced from the function/class that renders them) the commit I made was the best solution I could think of. If you know how to introduce i18n strings into yaml files or where this file is being rendered so I can pass in a hashtable that would be great! I also think the code could be refactored to use a function in those three spots instead of duplicate code, but it's 5am so I'll try and fix that tomorrow. Also note that the html has awful white spacing for some reason. I don't know how to fix that with mako. More discussion/information on this issue can be found in the issue thread linked above.\r\n\r\nObserve bad behavior:\r\n1. Load Studio.\r\n2. Log in as staff@example.com.\r\n3. Click \"Content\" and go to \"Outline\" in the dropdown.\r\n4. In Example Week 1 click on \"Homework.\"\r\n5. Click on any question from the dropdown.\r\n6. Click on \"Problem.\"\r\n7. Clicking on both \"Common Problem Types\" and \"Advanced,\" notice how some options are not i18n.\r\n\r\n~Please keep this webpage open after viewing the bad results~\r\n\r\nView Correction:\r\n1. Put my code into your edx-platform folder.\r\n2. Kill the studio process.\r\n3. While logged in as edxapp enter the following into your commandline: \r\npaver i18n_extract && paver i18n_dummy && paver i18n_generate && paver devstack studio\r\n4. Reload the studio page and notice how the strings are in the correct i18n format.","created_at":"2015-03-30T02:13:25Z","updated_at":"2015-03-30T14:22:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23039e100c6b6a7ce930e7ebaaab21969de42bfa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/7512/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/7512/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/7512/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/2194e061f35042d4b6eef570db71975fb5e7c4e6","head":{"label":"johnespinosa:patch-1","ref":"patch-1","sha":"2194e061f35042d4b6eef570db71975fb5e7c4e6","user":{"login":"johnespinosa","id":2852075,"avatar_url":"https://avatars.githubusercontent.com/u/2852075?v=3","gravatar_id":"","url":"https://api.github.com/users/johnespinosa","html_url":"https://github.com/johnespinosa","followers_url":"https://api.github.com/users/johnespinosa/followers","following_url":"https://api.github.com/users/johnespinosa/following{/other_user}","gists_url":"https://api.github.com/users/johnespinosa/gists{/gist_id}","starred_url":"https://api.github.com/users/johnespinosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnespinosa/subscriptions","organizations_url":"https://api.github.com/users/johnespinosa/orgs","repos_url":"https://api.github.com/users/johnespinosa/repos","events_url":"https://api.github.com/users/johnespinosa/events{/privacy}","received_events_url":"https://api.github.com/users/johnespinosa/received_events","type":"User","site_admin":false},"repo":{"id":33096939,"name":"edx-platform","full_name":"johnespinosa/edx-platform","owner":{"login":"johnespinosa","id":2852075,"avatar_url":"https://avatars.githubusercontent.com/u/2852075?v=3","gravatar_id":"","url":"https://api.github.com/users/johnespinosa","html_url":"https://github.com/johnespinosa","followers_url":"https://api.github.com/users/johnespinosa/followers","following_url":"https://api.github.com/users/johnespinosa/following{/other_user}","gists_url":"https://api.github.com/users/johnespinosa/gists{/gist_id}","starred_url":"https://api.github.com/users/johnespinosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnespinosa/subscriptions","organizations_url":"https://api.github.com/users/johnespinosa/orgs","repos_url":"https://api.github.com/users/johnespinosa/repos","events_url":"https://api.github.com/users/johnespinosa/events{/privacy}","received_events_url":"https://api.github.com/users/johnespinosa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/johnespinosa/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":true,"url":"https://api.github.com/repos/johnespinosa/edx-platform","forks_url":"https://api.github.com/repos/johnespinosa/edx-platform/forks","keys_url":"https://api.github.com/repos/johnespinosa/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/johnespinosa/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/johnespinosa/edx-platform/teams","hooks_url":"https://api.github.com/repos/johnespinosa/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/johnespinosa/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/johnespinosa/edx-platform/events","assignees_url":"https://api.github.com/repos/johnespinosa/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/johnespinosa/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/johnespinosa/edx-platform/tags","blobs_url":"https://api.github.com/repos/johnespinosa/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/johnespinosa/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/johnespinosa/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/johnespinosa/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/johnespinosa/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/johnespinosa/edx-platform/languages","stargazers_url":"https://api.github.com/repos/johnespinosa/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/johnespinosa/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/johnespinosa/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/johnespinosa/edx-platform/subscription","commits_url":"https://api.github.com/repos/johnespinosa/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/johnespinosa/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/johnespinosa/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/johnespinosa/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/johnespinosa/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/johnespinosa/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/johnespinosa/edx-platform/merges","archive_url":"https://api.github.com/repos/johnespinosa/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/johnespinosa/edx-platform/downloads","issues_url":"https://api.github.com/repos/johnespinosa/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/johnespinosa/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/johnespinosa/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/johnespinosa/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/johnespinosa/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/johnespinosa/edx-platform/releases{/id}","created_at":"2015-03-30T01:28:48Z","updated_at":"2015-03-30T01:29:19Z","pushed_at":"2015-03-30T03:35:05Z","git_url":"git://github.com/johnespinosa/edx-platform.git","ssh_url":"git@github.com:johnespinosa/edx-platform.git","clone_url":"https://github.com/johnespinosa/edx-platform.git","svn_url":"https://github.com/johnespinosa/edx-platform","homepage":"http://openedx.org/","size":423340,"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":"dad4b673e2e33c99f927d93a0de7d8b04851cce2","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":"Open edX, the edX platform that powers http://edx.org","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-03-30T14:03:25Z","pushed_at":"2015-03-30T14:17:43Z","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://openedx.org/","size":1842279,"stargazers_count":1826,"watchers_count":1826,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1031,"mirror_url":null,"open_issues_count":136,"forks":1031,"open_issues":136,"watchers":1826,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7512"},"html":{"href":"https://github.com/edx/edx-platform/pull/7512"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/7512"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/7512/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7512/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/7512/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/2194e061f35042d4b6eef570db71975fb5e7c4e6"}}}}