{"action":"created","comment":{"url":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/comments/82960601","pull_request_review_id":3830158,"id":82960601,"diff_hunk":"@@ -0,0 +1,98 @@\n+var path = require(\"path\");\n+var fs = require(\"fs\");\n+var csv = require(\"csv\");\n+var async = require(\"async\");\n+\n+module.exports = function (grunt) {\n+  \n+  grunt.registerTask(\"_exportLangFiles\", function () {\n+    \n+    var next = this.async();\n+    \n+    grunt.file.mkdir(\"languagefiles/\"+grunt.config(\"translate.masterLang\"));\n+    formatExport();\n+    \n+    \n+    \n+    function formatExport () {\n+      var filename = \"export\";\n+      \n+      switch (grunt.config(\"translate.format\")) {\n+        case \"json\":\n+          _exportRaw(filename);\n+          break;\n+        \n+        case \"csv\":\n+        default:\n+          _exportCSV(filename);\n+          break;\n+      }\n+    }\n+    \n+    \n+    function _exportCSV (filename) {\n+      var inputs = global.translate.exportTextData.reduce(function (prev, current) {\n+        if (!prev.hasOwnProperty(current.file)) {\n+          prev[current.file] = [];\n+        }\n+      \n+        prev[current.file].push([current.file+'/'+current.id+current.path, current.value]);\n+        return prev;\n+      }, {});\n+      \n+      var options = {\n+        quotedString: true,\n+        delimiter: grunt.config(\"translate.csvDelimiter\")\n+      };\n+      \n+      var fileNames = Object.keys(inputs);\n+      \n+      async.each(fileNames, _saveFile, _cb);\n+      \n+      function _saveFile (name, _cb) {\n+        csv.stringify(inputs[name], options, function (error, output) {\n+          if (error) {\n+            _cb(error);\n+          } else {\n+            var src = path.join(\"languagefiles\", grunt.config(\"translate.masterLang\"), name+\".csv\");\n+            grunt.file.write(src, \"\\ufeff\" + output);\n+            _cb();\n+          }\n+        });\n+      }\n+      \n+      function _cb (error) {\n+        if (error) {\n+          throw grunt.util.error(\"Error saving CSV files.\");\n+        }\n+        next();\n+      }\n+    }\n+    \n+    function _exportRaw (filename) {\n+      grunt.file.write(path.join(\"languagefiles\", grunt.config(\"translate.masterLang\"), filename+\".json\"), JSON.stringify(global.translate.exportTextData,\" \", 4));\n+      next();\n+    }\n+    \n+  });\n+  \n+};\n+\n+/*\n+\n+global.translate.exportTextData = [","path":"grunt/tasks/translate/exportFile.js","position":83,"original_position":83,"commit_id":"5302c5eaff9b9f77468bbf88401c2bf24c847fce","original_commit_id":"5302c5eaff9b9f77468bbf88401c2bf24c847fce","user":{"login":"brian-learningpool","id":1327471,"avatar_url":"https://avatars.githubusercontent.com/u/1327471?v=3","gravatar_id":"","url":"https://api.github.com/users/brian-learningpool","html_url":"https://github.com/brian-learningpool","followers_url":"https://api.github.com/users/brian-learningpool/followers","following_url":"https://api.github.com/users/brian-learningpool/following{/other_user}","gists_url":"https://api.github.com/users/brian-learningpool/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-learningpool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-learningpool/subscriptions","organizations_url":"https://api.github.com/users/brian-learningpool/orgs","repos_url":"https://api.github.com/users/brian-learningpool/repos","events_url":"https://api.github.com/users/brian-learningpool/events{/privacy}","received_events_url":"https://api.github.com/users/brian-learningpool/received_events","type":"User","site_admin":false},"body":"More commented out code.","created_at":"2016-10-12T08:47:08Z","updated_at":"2016-10-12T08:54:08Z","html_url":"https://github.com/adaptlearning/adapt_framework/pull/1264#discussion_r82960601","pull_request_url":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/1264","_links":{"self":{"href":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/comments/82960601"},"html":{"href":"https://github.com/adaptlearning/adapt_framework/pull/1264#discussion_r82960601"},"pull_request":{"href":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/1264"}}},"pull_request":{"url":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/1264","id":87912225,"html_url":"https://github.com/adaptlearning/adapt_framework/pull/1264","diff_url":"https://github.com/adaptlearning/adapt_framework/pull/1264.diff","patch_url":"https://github.com/adaptlearning/adapt_framework/pull/1264.patch","issue_url":"https://api.github.com/repos/adaptlearning/adapt_framework/issues/1264","number":1264,"state":"open","locked":false,"title":"multilanguage support","user":{"login":"lc-thomasberger","id":11990374,"avatar_url":"https://avatars.githubusercontent.com/u/11990374?v=3","gravatar_id":"","url":"https://api.github.com/users/lc-thomasberger","html_url":"https://github.com/lc-thomasberger","followers_url":"https://api.github.com/users/lc-thomasberger/followers","following_url":"https://api.github.com/users/lc-thomasberger/following{/other_user}","gists_url":"https://api.github.com/users/lc-thomasberger/gists{/gist_id}","starred_url":"https://api.github.com/users/lc-thomasberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lc-thomasberger/subscriptions","organizations_url":"https://api.github.com/users/lc-thomasberger/orgs","repos_url":"https://api.github.com/users/lc-thomasberger/repos","events_url":"https://api.github.com/users/lc-thomasberger/events{/privacy}","received_events_url":"https://api.github.com/users/lc-thomasberger/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-04T15:02:24Z","updated_at":"2016-10-12T08:54:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa3e2fbac2d9da1a325d73acfa2be48262ebce68","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/1264/commits","review_comments_url":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/1264/comments","review_comment_url":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adaptlearning/adapt_framework/issues/1264/comments","statuses_url":"https://api.github.com/repos/adaptlearning/adapt_framework/statuses/5302c5eaff9b9f77468bbf88401c2bf24c847fce","head":{"label":"adaptlearning:feature/ml","ref":"feature/ml","sha":"5302c5eaff9b9f77468bbf88401c2bf24c847fce","user":{"login":"adaptlearning","id":5629464,"avatar_url":"https://avatars.githubusercontent.com/u/5629464?v=3","gravatar_id":"","url":"https://api.github.com/users/adaptlearning","html_url":"https://github.com/adaptlearning","followers_url":"https://api.github.com/users/adaptlearning/followers","following_url":"https://api.github.com/users/adaptlearning/following{/other_user}","gists_url":"https://api.github.com/users/adaptlearning/gists{/gist_id}","starred_url":"https://api.github.com/users/adaptlearning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adaptlearning/subscriptions","organizations_url":"https://api.github.com/users/adaptlearning/orgs","repos_url":"https://api.github.com/users/adaptlearning/repos","events_url":"https://api.github.com/users/adaptlearning/events{/privacy}","received_events_url":"https://api.github.com/users/adaptlearning/received_events","type":"Organization","site_admin":false},"repo":{"id":13442719,"name":"adapt_framework","full_name":"adaptlearning/adapt_framework","owner":{"login":"adaptlearning","id":5629464,"avatar_url":"https://avatars.githubusercontent.com/u/5629464?v=3","gravatar_id":"","url":"https://api.github.com/users/adaptlearning","html_url":"https://github.com/adaptlearning","followers_url":"https://api.github.com/users/adaptlearning/followers","following_url":"https://api.github.com/users/adaptlearning/following{/other_user}","gists_url":"https://api.github.com/users/adaptlearning/gists{/gist_id}","starred_url":"https://api.github.com/users/adaptlearning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adaptlearning/subscriptions","organizations_url":"https://api.github.com/users/adaptlearning/orgs","repos_url":"https://api.github.com/users/adaptlearning/repos","events_url":"https://api.github.com/users/adaptlearning/events{/privacy}","received_events_url":"https://api.github.com/users/adaptlearning/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adaptlearning/adapt_framework","description":"This is the output framework of the Adapt Learning open source project ","fork":false,"url":"https://api.github.com/repos/adaptlearning/adapt_framework","forks_url":"https://api.github.com/repos/adaptlearning/adapt_framework/forks","keys_url":"https://api.github.com/repos/adaptlearning/adapt_framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adaptlearning/adapt_framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adaptlearning/adapt_framework/teams","hooks_url":"https://api.github.com/repos/adaptlearning/adapt_framework/hooks","issue_events_url":"https://api.github.com/repos/adaptlearning/adapt_framework/issues/events{/number}","events_url":"https://api.github.com/repos/adaptlearning/adapt_framework/events","assignees_url":"https://api.github.com/repos/adaptlearning/adapt_framework/assignees{/user}","branches_url":"https://api.github.com/repos/adaptlearning/adapt_framework/branches{/branch}","tags_url":"https://api.github.com/repos/adaptlearning/adapt_framework/tags","blobs_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adaptlearning/adapt_framework/statuses/{sha}","languages_url":"https://api.github.com/repos/adaptlearning/adapt_framework/languages","stargazers_url":"https://api.github.com/repos/adaptlearning/adapt_framework/stargazers","contributors_url":"https://api.github.com/repos/adaptlearning/adapt_framework/contributors","subscribers_url":"https://api.github.com/repos/adaptlearning/adapt_framework/subscribers","subscription_url":"https://api.github.com/repos/adaptlearning/adapt_framework/subscription","commits_url":"https://api.github.com/repos/adaptlearning/adapt_framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/adaptlearning/adapt_framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/adaptlearning/adapt_framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/adaptlearning/adapt_framework/contents/{+path}","compare_url":"https://api.github.com/repos/adaptlearning/adapt_framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adaptlearning/adapt_framework/merges","archive_url":"https://api.github.com/repos/adaptlearning/adapt_framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adaptlearning/adapt_framework/downloads","issues_url":"https://api.github.com/repos/adaptlearning/adapt_framework/issues{/number}","pulls_url":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls{/number}","milestones_url":"https://api.github.com/repos/adaptlearning/adapt_framework/milestones{/number}","notifications_url":"https://api.github.com/repos/adaptlearning/adapt_framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adaptlearning/adapt_framework/labels{/name}","releases_url":"https://api.github.com/repos/adaptlearning/adapt_framework/releases{/id}","deployments_url":"https://api.github.com/repos/adaptlearning/adapt_framework/deployments","created_at":"2013-10-09T13:15:44Z","updated_at":"2016-09-23T15:06:01Z","pushed_at":"2016-10-12T07:05:30Z","git_url":"git://github.com/adaptlearning/adapt_framework.git","ssh_url":"git@github.com:adaptlearning/adapt_framework.git","clone_url":"https://github.com/adaptlearning/adapt_framework.git","svn_url":"https://github.com/adaptlearning/adapt_framework","homepage":null,"size":58927,"stargazers_count":216,"watchers_count":216,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":122,"mirror_url":null,"open_issues_count":111,"forks":122,"open_issues":111,"watchers":216,"default_branch":"master"}},"base":{"label":"adaptlearning:master","ref":"master","sha":"cf217279b76c9284864e0497b908d062ec4a03fb","user":{"login":"adaptlearning","id":5629464,"avatar_url":"https://avatars.githubusercontent.com/u/5629464?v=3","gravatar_id":"","url":"https://api.github.com/users/adaptlearning","html_url":"https://github.com/adaptlearning","followers_url":"https://api.github.com/users/adaptlearning/followers","following_url":"https://api.github.com/users/adaptlearning/following{/other_user}","gists_url":"https://api.github.com/users/adaptlearning/gists{/gist_id}","starred_url":"https://api.github.com/users/adaptlearning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adaptlearning/subscriptions","organizations_url":"https://api.github.com/users/adaptlearning/orgs","repos_url":"https://api.github.com/users/adaptlearning/repos","events_url":"https://api.github.com/users/adaptlearning/events{/privacy}","received_events_url":"https://api.github.com/users/adaptlearning/received_events","type":"Organization","site_admin":false},"repo":{"id":13442719,"name":"adapt_framework","full_name":"adaptlearning/adapt_framework","owner":{"login":"adaptlearning","id":5629464,"avatar_url":"https://avatars.githubusercontent.com/u/5629464?v=3","gravatar_id":"","url":"https://api.github.com/users/adaptlearning","html_url":"https://github.com/adaptlearning","followers_url":"https://api.github.com/users/adaptlearning/followers","following_url":"https://api.github.com/users/adaptlearning/following{/other_user}","gists_url":"https://api.github.com/users/adaptlearning/gists{/gist_id}","starred_url":"https://api.github.com/users/adaptlearning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adaptlearning/subscriptions","organizations_url":"https://api.github.com/users/adaptlearning/orgs","repos_url":"https://api.github.com/users/adaptlearning/repos","events_url":"https://api.github.com/users/adaptlearning/events{/privacy}","received_events_url":"https://api.github.com/users/adaptlearning/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adaptlearning/adapt_framework","description":"This is the output framework of the Adapt Learning open source project ","fork":false,"url":"https://api.github.com/repos/adaptlearning/adapt_framework","forks_url":"https://api.github.com/repos/adaptlearning/adapt_framework/forks","keys_url":"https://api.github.com/repos/adaptlearning/adapt_framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adaptlearning/adapt_framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adaptlearning/adapt_framework/teams","hooks_url":"https://api.github.com/repos/adaptlearning/adapt_framework/hooks","issue_events_url":"https://api.github.com/repos/adaptlearning/adapt_framework/issues/events{/number}","events_url":"https://api.github.com/repos/adaptlearning/adapt_framework/events","assignees_url":"https://api.github.com/repos/adaptlearning/adapt_framework/assignees{/user}","branches_url":"https://api.github.com/repos/adaptlearning/adapt_framework/branches{/branch}","tags_url":"https://api.github.com/repos/adaptlearning/adapt_framework/tags","blobs_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adaptlearning/adapt_framework/statuses/{sha}","languages_url":"https://api.github.com/repos/adaptlearning/adapt_framework/languages","stargazers_url":"https://api.github.com/repos/adaptlearning/adapt_framework/stargazers","contributors_url":"https://api.github.com/repos/adaptlearning/adapt_framework/contributors","subscribers_url":"https://api.github.com/repos/adaptlearning/adapt_framework/subscribers","subscription_url":"https://api.github.com/repos/adaptlearning/adapt_framework/subscription","commits_url":"https://api.github.com/repos/adaptlearning/adapt_framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/adaptlearning/adapt_framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/adaptlearning/adapt_framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/adaptlearning/adapt_framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/adaptlearning/adapt_framework/contents/{+path}","compare_url":"https://api.github.com/repos/adaptlearning/adapt_framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adaptlearning/adapt_framework/merges","archive_url":"https://api.github.com/repos/adaptlearning/adapt_framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adaptlearning/adapt_framework/downloads","issues_url":"https://api.github.com/repos/adaptlearning/adapt_framework/issues{/number}","pulls_url":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls{/number}","milestones_url":"https://api.github.com/repos/adaptlearning/adapt_framework/milestones{/number}","notifications_url":"https://api.github.com/repos/adaptlearning/adapt_framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adaptlearning/adapt_framework/labels{/name}","releases_url":"https://api.github.com/repos/adaptlearning/adapt_framework/releases{/id}","deployments_url":"https://api.github.com/repos/adaptlearning/adapt_framework/deployments","created_at":"2013-10-09T13:15:44Z","updated_at":"2016-09-23T15:06:01Z","pushed_at":"2016-10-12T07:05:30Z","git_url":"git://github.com/adaptlearning/adapt_framework.git","ssh_url":"git@github.com:adaptlearning/adapt_framework.git","clone_url":"https://github.com/adaptlearning/adapt_framework.git","svn_url":"https://github.com/adaptlearning/adapt_framework","homepage":null,"size":58927,"stargazers_count":216,"watchers_count":216,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":122,"mirror_url":null,"open_issues_count":111,"forks":122,"open_issues":111,"watchers":216,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/1264"},"html":{"href":"https://github.com/adaptlearning/adapt_framework/pull/1264"},"issue":{"href":"https://api.github.com/repos/adaptlearning/adapt_framework/issues/1264"},"comments":{"href":"https://api.github.com/repos/adaptlearning/adapt_framework/issues/1264/comments"},"review_comments":{"href":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/1264/comments"},"review_comment":{"href":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adaptlearning/adapt_framework/pulls/1264/commits"},"statuses":{"href":"https://api.github.com/repos/adaptlearning/adapt_framework/statuses/5302c5eaff9b9f77468bbf88401c2bf24c847fce"}}}}
{"actor":{"display_login":"brian-learningpool"}}