{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/comments/52082109","id":52082109,"diff_hunk":"@@ -0,0 +1,58 @@\n+\"use strict\";\n+\n+let fs = require(\"q-io/fs\");\n+let path = require(\"path\");\n+let chokidar = require(\"chokidar\");\n+let colors = require(\"colors\");\n+\n+let getListLocales = require(\"./common\").getListLocales;\n+let localizeClient = require(\"./localize-client\");\n+let env = require(\"../server/lib/environment\");\n+\n+let root = process.cwd();\n+let localeDir = path.join(root, env.get(\"L10N\").locale_dest || \"dist/locales\");\n+let dest = path.join(root, \"client\");\n+let localeDirList;\n+\n+let log = {\n+  args(color) {\n+    return Array.prototype.map.call(this, arg => typeof arg === \"string\" ? colors[color](arg) : arg);\n+  },\n+  error() {\n+    console.log.apply(console, arguments ? log.args.call(arguments, \"red\") : null);\n+  },\n+  info() {\n+    console.log.apply(console, arguments ? log.args.call(arguments, \"green\") : null);\n+  }\n+};\n+\n+function deleteFile(relativeFilePath) {\n+  let deleteLocalizedFile = localeDirList.map(localeDir => fs.remove(path.join(localeDir, relativeFilePath)));","path":"scripts/watch-client.js","position":30,"original_position":30,"commit_id":"3ce455333d2d91ccb7f585875c0d86a77c7476cc","original_commit_id":"3ce455333d2d91ccb7f585875c0d86a77c7476cc","user":{"login":"alicoding","id":4368149,"avatar_url":"https://avatars.githubusercontent.com/u/4368149?v=3","gravatar_id":"","url":"https://api.github.com/users/alicoding","html_url":"https://github.com/alicoding","followers_url":"https://api.github.com/users/alicoding/followers","following_url":"https://api.github.com/users/alicoding/following{/other_user}","gists_url":"https://api.github.com/users/alicoding/gists{/gist_id}","starred_url":"https://api.github.com/users/alicoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alicoding/subscriptions","organizations_url":"https://api.github.com/users/alicoding/orgs","repos_url":"https://api.github.com/users/alicoding/repos","events_url":"https://api.github.com/users/alicoding/events{/privacy}","received_events_url":"https://api.github.com/users/alicoding/received_events","type":"User","site_admin":false},"body":"Alright","created_at":"2016-02-05T22:34:01Z","updated_at":"2016-02-05T22:34:01Z","html_url":"https://github.com/mozilla/thimble.webmaker.org/pull/1383#discussion_r52082109","pull_request_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/1383","_links":{"self":{"href":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/comments/52082109"},"html":{"href":"https://github.com/mozilla/thimble.webmaker.org/pull/1383#discussion_r52082109"},"pull_request":{"href":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/1383"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/1383","id":58461409,"html_url":"https://github.com/mozilla/thimble.webmaker.org/pull/1383","diff_url":"https://github.com/mozilla/thimble.webmaker.org/pull/1383.diff","patch_url":"https://github.com/mozilla/thimble.webmaker.org/pull/1383.patch","issue_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/1383","number":1383,"state":"open","locked":false,"title":"Automatically update built localized client files on src change","user":{"login":"gideonthomas","id":5816130,"avatar_url":"https://avatars.githubusercontent.com/u/5816130?v=3","gravatar_id":"","url":"https://api.github.com/users/gideonthomas","html_url":"https://github.com/gideonthomas","followers_url":"https://api.github.com/users/gideonthomas/followers","following_url":"https://api.github.com/users/gideonthomas/following{/other_user}","gists_url":"https://api.github.com/users/gideonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/gideonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gideonthomas/subscriptions","organizations_url":"https://api.github.com/users/gideonthomas/orgs","repos_url":"https://api.github.com/users/gideonthomas/repos","events_url":"https://api.github.com/users/gideonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/gideonthomas/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-05T17:48:59Z","updated_at":"2016-02-05T22:34:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb44b8a00adabc23c95cb9ec900036454ccb3c04","assignee":{"login":"alicoding","id":4368149,"avatar_url":"https://avatars.githubusercontent.com/u/4368149?v=3","gravatar_id":"","url":"https://api.github.com/users/alicoding","html_url":"https://github.com/alicoding","followers_url":"https://api.github.com/users/alicoding/followers","following_url":"https://api.github.com/users/alicoding/following{/other_user}","gists_url":"https://api.github.com/users/alicoding/gists{/gist_id}","starred_url":"https://api.github.com/users/alicoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alicoding/subscriptions","organizations_url":"https://api.github.com/users/alicoding/orgs","repos_url":"https://api.github.com/users/alicoding/repos","events_url":"https://api.github.com/users/alicoding/events{/privacy}","received_events_url":"https://api.github.com/users/alicoding/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/1383/commits","review_comments_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/1383/comments","review_comment_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/1383/comments","statuses_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/statuses/3ce455333d2d91ccb7f585875c0d86a77c7476cc","head":{"label":"gideonthomas:l10nclient2","ref":"l10nclient2","sha":"3ce455333d2d91ccb7f585875c0d86a77c7476cc","user":{"login":"gideonthomas","id":5816130,"avatar_url":"https://avatars.githubusercontent.com/u/5816130?v=3","gravatar_id":"","url":"https://api.github.com/users/gideonthomas","html_url":"https://github.com/gideonthomas","followers_url":"https://api.github.com/users/gideonthomas/followers","following_url":"https://api.github.com/users/gideonthomas/following{/other_user}","gists_url":"https://api.github.com/users/gideonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/gideonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gideonthomas/subscriptions","organizations_url":"https://api.github.com/users/gideonthomas/orgs","repos_url":"https://api.github.com/users/gideonthomas/repos","events_url":"https://api.github.com/users/gideonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/gideonthomas/received_events","type":"User","site_admin":false},"repo":{"id":31554137,"name":"thimble.webmaker.org","full_name":"gideonthomas/thimble.webmaker.org","owner":{"login":"gideonthomas","id":5816130,"avatar_url":"https://avatars.githubusercontent.com/u/5816130?v=3","gravatar_id":"","url":"https://api.github.com/users/gideonthomas","html_url":"https://github.com/gideonthomas","followers_url":"https://api.github.com/users/gideonthomas/followers","following_url":"https://api.github.com/users/gideonthomas/following{/other_user}","gists_url":"https://api.github.com/users/gideonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/gideonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gideonthomas/subscriptions","organizations_url":"https://api.github.com/users/gideonthomas/orgs","repos_url":"https://api.github.com/users/gideonthomas/repos","events_url":"https://api.github.com/users/gideonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/gideonthomas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gideonthomas/thimble.webmaker.org","description":"a minimal thimble on node.js POC","fork":true,"url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org","forks_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/forks","keys_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/teams","hooks_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/hooks","issue_events_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/issues/events{/number}","events_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/events","assignees_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/assignees{/user}","branches_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/branches{/branch}","tags_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/tags","blobs_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/statuses/{sha}","languages_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/languages","stargazers_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/stargazers","contributors_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/contributors","subscribers_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/subscribers","subscription_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/subscription","commits_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/contents/{+path}","compare_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/merges","archive_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/downloads","issues_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/issues{/number}","pulls_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/pulls{/number}","milestones_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/milestones{/number}","notifications_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/labels{/name}","releases_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/releases{/id}","deployments_url":"https://api.github.com/repos/gideonthomas/thimble.webmaker.org/deployments","created_at":"2015-03-02T17:51:20Z","updated_at":"2015-03-02T17:51:21Z","pushed_at":"2016-02-05T17:48:38Z","git_url":"git://github.com/gideonthomas/thimble.webmaker.org.git","ssh_url":"git@github.com:gideonthomas/thimble.webmaker.org.git","clone_url":"https://github.com/gideonthomas/thimble.webmaker.org.git","svn_url":"https://github.com/gideonthomas/thimble.webmaker.org","homepage":null,"size":18784,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"mvpIntegration"}},"base":{"label":"mozilla:bramble","ref":"bramble","sha":"67d50bf825a94aa092cbed4e8d7eac2787a742e3","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":9349840,"name":"thimble.webmaker.org","full_name":"mozilla/thimble.webmaker.org","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/thimble.webmaker.org","description":"Online code editor geared to people teaching and learning HTML, CSS, and JavaScript.","fork":false,"url":"https://api.github.com/repos/mozilla/thimble.webmaker.org","forks_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/forks","keys_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/teams","hooks_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/hooks","issue_events_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/events","assignees_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/tags","blobs_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/languages","stargazers_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/stargazers","contributors_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/contributors","subscribers_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/subscribers","subscription_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/subscription","commits_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/merges","archive_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/downloads","issues_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/thimble.webmaker.org/deployments","created_at":"2013-04-10T15:54:34Z","updated_at":"2016-02-04T19:01:04Z","pushed_at":"2016-02-05T17:48:59Z","git_url":"git://github.com/mozilla/thimble.webmaker.org.git","ssh_url":"git@github.com:mozilla/thimble.webmaker.org.git","clone_url":"https://github.com/mozilla/thimble.webmaker.org.git","svn_url":"https://github.com/mozilla/thimble.webmaker.org","homepage":"https://thimble.mozilla.org","size":20154,"stargazers_count":271,"watchers_count":271,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":110,"mirror_url":null,"open_issues_count":111,"forks":110,"open_issues":111,"watchers":271,"default_branch":"bramble"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/1383"},"html":{"href":"https://github.com/mozilla/thimble.webmaker.org/pull/1383"},"issue":{"href":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/1383"},"comments":{"href":"https://api.github.com/repos/mozilla/thimble.webmaker.org/issues/1383/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/1383/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/thimble.webmaker.org/pulls/1383/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/thimble.webmaker.org/statuses/3ce455333d2d91ccb7f585875c0d86a77c7476cc"}}}}