{"action":"created","comment":{"url":"https://api.github.com/repos/codevise/pageflow/pulls/comments/37855793","id":37855793,"diff_hunk":"@@ -0,0 +1,24 @@\n+support.useFakeTranslations = function(translations) {\n+  beforeEach(function() {\n+    this._originalTranslations = I18n.translations;\n+\n+    var nested = _(translations).reduce(function(result, value, key) {\n+      var keys = key.split('.');\n+      var last = keys.pop();\n+\n+      var inner = _(keys).reduce(function(r, key) {\n+        r[key] = r[key] || {};\n+        return r[key];\n+      }, result);\n+\n+      inner[last] = value;\n+      return result;\n+    }, {});\n+\n+    I18n.translations = {en: nested};\n+  });\n+\n+  afterEach(function() {","path":"spec/javascripts/support/use_fake_translations.js","position":21,"original_position":21,"commit_id":"1737f557a33fe86f599cd70c50189667696ab6ef","original_commit_id":"1737f557a33fe86f599cd70c50189667696ab6ef","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"'afterEach' is not defined.","created_at":"2015-08-25T11:45:37Z","updated_at":"2015-08-25T11:45:37Z","html_url":"https://github.com/codevise/pageflow/pull/395#discussion_r37855793","pull_request_url":"https://api.github.com/repos/codevise/pageflow/pulls/395","_links":{"self":{"href":"https://api.github.com/repos/codevise/pageflow/pulls/comments/37855793"},"html":{"href":"https://github.com/codevise/pageflow/pull/395#discussion_r37855793"},"pull_request":{"href":"https://api.github.com/repos/codevise/pageflow/pulls/395"}}},"pull_request":{"url":"https://api.github.com/repos/codevise/pageflow/pulls/395","id":43276019,"html_url":"https://github.com/codevise/pageflow/pull/395","diff_url":"https://github.com/codevise/pageflow/pull/395.diff","patch_url":"https://github.com/codevise/pageflow/pull/395.patch","issue_url":"https://api.github.com/repos/codevise/pageflow/issues/395","number":395,"state":"open","locked":false,"title":"Page Attribute Translation Key Prefixes","user":{"login":"tf","id":26554,"avatar_url":"https://avatars.githubusercontent.com/u/26554?v=3","gravatar_id":"","url":"https://api.github.com/users/tf","html_url":"https://github.com/tf","followers_url":"https://api.github.com/users/tf/followers","following_url":"https://api.github.com/users/tf/following{/other_user}","gists_url":"https://api.github.com/users/tf/gists{/gist_id}","starred_url":"https://api.github.com/users/tf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tf/subscriptions","organizations_url":"https://api.github.com/users/tf/orgs","repos_url":"https://api.github.com/users/tf/repos","events_url":"https://api.github.com/users/tf/events{/privacy}","received_events_url":"https://api.github.com/users/tf/received_events","type":"User","site_admin":false},"body":"Before, translations for page attribute labels and inline help texts were looked up in the `activerecord.attributes` and `pageflow.ui.inline_help` scopes. Translations for select box entries\r\nwhere looked up in `activerecord.values`.  This caused three problems:\r\n\r\n* No two page types could use different texts for the same attribute.\r\n\r\n* Active record scopes reveal too much implementation details. Should\r\n  be `pageflow...` scope.\r\n\r\n* Translations for an attribute were scattered accross different\r\n  parent scopes.\r\n\r\nIntroduce new scopes for common and page type specific attribute translations:\r\n\r\n    pageflow.common_page_attributes.<attribute>.label\r\n    pageflow.common_page_attributes.<attribute>.inline_help\r\n    pageflow.common_page_attributes.<attribute>.inline_help_disabled\r\n    pageflow.common_page_attributes.<attribute>.values\r\n\r\n    <page_type_translation_key_prefix>.page_attributes.<attribute>.label\r\n    <page_type_translation_key_prefix>.page_attributes.<attribute>.inline_help\r\n    <page_type_translation_key_prefix>.page_attributes.<attribute>.inline_help_disabled\r\n    <page_type_translation_key_prefix>.page_attributes.<attribute>.values","created_at":"2015-08-25T11:45:27Z","updated_at":"2015-08-25T11:45:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f93396ae3061be9ff0ab4d20b2d3333c6e22cf18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codevise/pageflow/pulls/395/commits","review_comments_url":"https://api.github.com/repos/codevise/pageflow/pulls/395/comments","review_comment_url":"https://api.github.com/repos/codevise/pageflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codevise/pageflow/issues/395/comments","statuses_url":"https://api.github.com/repos/codevise/pageflow/statuses/1737f557a33fe86f599cd70c50189667696ab6ef","head":{"label":"tf:attribute-translations","ref":"attribute-translations","sha":"1737f557a33fe86f599cd70c50189667696ab6ef","user":{"login":"tf","id":26554,"avatar_url":"https://avatars.githubusercontent.com/u/26554?v=3","gravatar_id":"","url":"https://api.github.com/users/tf","html_url":"https://github.com/tf","followers_url":"https://api.github.com/users/tf/followers","following_url":"https://api.github.com/users/tf/following{/other_user}","gists_url":"https://api.github.com/users/tf/gists{/gist_id}","starred_url":"https://api.github.com/users/tf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tf/subscriptions","organizations_url":"https://api.github.com/users/tf/orgs","repos_url":"https://api.github.com/users/tf/repos","events_url":"https://api.github.com/users/tf/events{/privacy}","received_events_url":"https://api.github.com/users/tf/received_events","type":"User","site_admin":false},"repo":{"id":21001960,"name":"pageflow","full_name":"tf/pageflow","owner":{"login":"tf","id":26554,"avatar_url":"https://avatars.githubusercontent.com/u/26554?v=3","gravatar_id":"","url":"https://api.github.com/users/tf","html_url":"https://github.com/tf","followers_url":"https://api.github.com/users/tf/followers","following_url":"https://api.github.com/users/tf/following{/other_user}","gists_url":"https://api.github.com/users/tf/gists{/gist_id}","starred_url":"https://api.github.com/users/tf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tf/subscriptions","organizations_url":"https://api.github.com/users/tf/orgs","repos_url":"https://api.github.com/users/tf/repos","events_url":"https://api.github.com/users/tf/events{/privacy}","received_events_url":"https://api.github.com/users/tf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tf/pageflow","description":"Multimedia story telling for the web.","fork":true,"url":"https://api.github.com/repos/tf/pageflow","forks_url":"https://api.github.com/repos/tf/pageflow/forks","keys_url":"https://api.github.com/repos/tf/pageflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tf/pageflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tf/pageflow/teams","hooks_url":"https://api.github.com/repos/tf/pageflow/hooks","issue_events_url":"https://api.github.com/repos/tf/pageflow/issues/events{/number}","events_url":"https://api.github.com/repos/tf/pageflow/events","assignees_url":"https://api.github.com/repos/tf/pageflow/assignees{/user}","branches_url":"https://api.github.com/repos/tf/pageflow/branches{/branch}","tags_url":"https://api.github.com/repos/tf/pageflow/tags","blobs_url":"https://api.github.com/repos/tf/pageflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tf/pageflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tf/pageflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/tf/pageflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tf/pageflow/statuses/{sha}","languages_url":"https://api.github.com/repos/tf/pageflow/languages","stargazers_url":"https://api.github.com/repos/tf/pageflow/stargazers","contributors_url":"https://api.github.com/repos/tf/pageflow/contributors","subscribers_url":"https://api.github.com/repos/tf/pageflow/subscribers","subscription_url":"https://api.github.com/repos/tf/pageflow/subscription","commits_url":"https://api.github.com/repos/tf/pageflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/tf/pageflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/tf/pageflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/tf/pageflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/tf/pageflow/contents/{+path}","compare_url":"https://api.github.com/repos/tf/pageflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tf/pageflow/merges","archive_url":"https://api.github.com/repos/tf/pageflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tf/pageflow/downloads","issues_url":"https://api.github.com/repos/tf/pageflow/issues{/number}","pulls_url":"https://api.github.com/repos/tf/pageflow/pulls{/number}","milestones_url":"https://api.github.com/repos/tf/pageflow/milestones{/number}","notifications_url":"https://api.github.com/repos/tf/pageflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tf/pageflow/labels{/name}","releases_url":"https://api.github.com/repos/tf/pageflow/releases{/id}","created_at":"2014-06-19T13:50:32Z","updated_at":"2015-05-04T15:18:38Z","pushed_at":"2015-08-25T11:01:01Z","git_url":"git://github.com/tf/pageflow.git","ssh_url":"git@github.com:tf/pageflow.git","clone_url":"https://github.com/tf/pageflow.git","svn_url":"https://github.com/tf/pageflow","homepage":"http://pageflow.io","size":10634,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"codevise:master","ref":"master","sha":"228e2281beea3df6a97b44ebdc25470c06f2cc06","user":{"login":"codevise","id":537804,"avatar_url":"https://avatars.githubusercontent.com/u/537804?v=3","gravatar_id":"","url":"https://api.github.com/users/codevise","html_url":"https://github.com/codevise","followers_url":"https://api.github.com/users/codevise/followers","following_url":"https://api.github.com/users/codevise/following{/other_user}","gists_url":"https://api.github.com/users/codevise/gists{/gist_id}","starred_url":"https://api.github.com/users/codevise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codevise/subscriptions","organizations_url":"https://api.github.com/users/codevise/orgs","repos_url":"https://api.github.com/users/codevise/repos","events_url":"https://api.github.com/users/codevise/events{/privacy}","received_events_url":"https://api.github.com/users/codevise/received_events","type":"Organization","site_admin":false},"repo":{"id":19446839,"name":"pageflow","full_name":"codevise/pageflow","owner":{"login":"codevise","id":537804,"avatar_url":"https://avatars.githubusercontent.com/u/537804?v=3","gravatar_id":"","url":"https://api.github.com/users/codevise","html_url":"https://github.com/codevise","followers_url":"https://api.github.com/users/codevise/followers","following_url":"https://api.github.com/users/codevise/following{/other_user}","gists_url":"https://api.github.com/users/codevise/gists{/gist_id}","starred_url":"https://api.github.com/users/codevise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codevise/subscriptions","organizations_url":"https://api.github.com/users/codevise/orgs","repos_url":"https://api.github.com/users/codevise/repos","events_url":"https://api.github.com/users/codevise/events{/privacy}","received_events_url":"https://api.github.com/users/codevise/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codevise/pageflow","description":"Multimedia story telling for the web.","fork":false,"url":"https://api.github.com/repos/codevise/pageflow","forks_url":"https://api.github.com/repos/codevise/pageflow/forks","keys_url":"https://api.github.com/repos/codevise/pageflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codevise/pageflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codevise/pageflow/teams","hooks_url":"https://api.github.com/repos/codevise/pageflow/hooks","issue_events_url":"https://api.github.com/repos/codevise/pageflow/issues/events{/number}","events_url":"https://api.github.com/repos/codevise/pageflow/events","assignees_url":"https://api.github.com/repos/codevise/pageflow/assignees{/user}","branches_url":"https://api.github.com/repos/codevise/pageflow/branches{/branch}","tags_url":"https://api.github.com/repos/codevise/pageflow/tags","blobs_url":"https://api.github.com/repos/codevise/pageflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codevise/pageflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codevise/pageflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/codevise/pageflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codevise/pageflow/statuses/{sha}","languages_url":"https://api.github.com/repos/codevise/pageflow/languages","stargazers_url":"https://api.github.com/repos/codevise/pageflow/stargazers","contributors_url":"https://api.github.com/repos/codevise/pageflow/contributors","subscribers_url":"https://api.github.com/repos/codevise/pageflow/subscribers","subscription_url":"https://api.github.com/repos/codevise/pageflow/subscription","commits_url":"https://api.github.com/repos/codevise/pageflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/codevise/pageflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/codevise/pageflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/codevise/pageflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/codevise/pageflow/contents/{+path}","compare_url":"https://api.github.com/repos/codevise/pageflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codevise/pageflow/merges","archive_url":"https://api.github.com/repos/codevise/pageflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codevise/pageflow/downloads","issues_url":"https://api.github.com/repos/codevise/pageflow/issues{/number}","pulls_url":"https://api.github.com/repos/codevise/pageflow/pulls{/number}","milestones_url":"https://api.github.com/repos/codevise/pageflow/milestones{/number}","notifications_url":"https://api.github.com/repos/codevise/pageflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codevise/pageflow/labels{/name}","releases_url":"https://api.github.com/repos/codevise/pageflow/releases{/id}","created_at":"2014-05-05T06:50:13Z","updated_at":"2015-08-25T06:49:37Z","pushed_at":"2015-08-25T11:45:27Z","git_url":"git://github.com/codevise/pageflow.git","ssh_url":"git@github.com:codevise/pageflow.git","clone_url":"https://github.com/codevise/pageflow.git","svn_url":"https://github.com/codevise/pageflow","homepage":"http://pageflow.io","size":12047,"stargazers_count":246,"watchers_count":246,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":13,"forks":57,"open_issues":13,"watchers":246,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codevise/pageflow/pulls/395"},"html":{"href":"https://github.com/codevise/pageflow/pull/395"},"issue":{"href":"https://api.github.com/repos/codevise/pageflow/issues/395"},"comments":{"href":"https://api.github.com/repos/codevise/pageflow/issues/395/comments"},"review_comments":{"href":"https://api.github.com/repos/codevise/pageflow/pulls/395/comments"},"review_comment":{"href":"https://api.github.com/repos/codevise/pageflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codevise/pageflow/pulls/395/commits"},"statuses":{"href":"https://api.github.com/repos/codevise/pageflow/statuses/1737f557a33fe86f599cd70c50189667696ab6ef"}}}}