{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/40424845","id":40424845,"diff_hunk":"@@ -0,0 +1,222 @@\n+(function(global) {\n+'use strict';\n+\n+global.mozIntl = {\n+  /**\n+   * Format an Array of strings using locale specific separators.\n+   * Currently it only uses middle separator resulting in a local\n+   * equivalent of 'X, Y, Z'.\n+   *\n+   * In the Intl API it will support start/end separators allowing for\n+   * things like 'X, Y and Z'.\n+   *\n+   * @param {Array} An array of strings to be formatted\n+   * @returns {Promise} A promise of a string\n+   */\n+  formatList: function(list) {\n+    return navigator.mozL10n.formatValue('listSeparator_middle').then(sep => {\n+      return list.join(sep);\n+    });\n+  },\n+\n+  /**\n+   * Overload of Intl.DateTimeFormat that extends with future features.\n+   *\n+   * 1) dayperiod token\n+   *\n+   * `dayperiod` token allows to decide whether the formatted time should\n+   * contain dayperiod token. The value may be true or false.\n+   *\n+   * Example:\n+   *\n+   * mozIntl.DateTimeFormat(navigator.languages, {\n+   *   dayperiod: true,\n+   *   hour12: navigator.mozHour12,\n+   *   hour: 'numeric',\n+   *   minute: 'numeric'\n+   * });\n+   *\n+   * 2) Token formatting\n+   *\n+   * This feature allows for formatting of tokens in the result string.\n+   *\n+   * Example:\n+   *\n+   * var f = mozIntl.DateTimeFormat(navigator.languages, {\n+   *   weekday: 'long',\n+   *   day: 'numeric',\n+   *   month: 'long'\n+   * });\n+   * \n+   * f.format(date, {\n+   *  day: '<strong>$&</strong>',\n+   * });\n+   *\n+   * Warning: Current implementation is very fragile. Be very careful when\n+   * choosing tokens to be formatted. The formatter will replace the\n+   * first occurance of the returned string, so if you try to format","path":"shared/js/moz_intl.js","position":57,"original_position":57,"commit_id":"9b283070cd40fac10baab38a3737fa810ad469b7","original_commit_id":"9b283070cd40fac10baab38a3737fa810ad469b7","user":{"login":"stasm","id":265818,"avatar_url":"https://avatars.githubusercontent.com/u/265818?v=3","gravatar_id":"","url":"https://api.github.com/users/stasm","html_url":"https://github.com/stasm","followers_url":"https://api.github.com/users/stasm/followers","following_url":"https://api.github.com/users/stasm/following{/other_user}","gists_url":"https://api.github.com/users/stasm/gists{/gist_id}","starred_url":"https://api.github.com/users/stasm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stasm/subscriptions","organizations_url":"https://api.github.com/users/stasm/orgs","repos_url":"https://api.github.com/users/stasm/repos","events_url":"https://api.github.com/users/stasm/events{/privacy}","received_events_url":"https://api.github.com/users/stasm/received_events","type":"User","site_admin":false},"body":"Nit: typo in 'occurrence'.","created_at":"2015-09-25T12:40:46Z","updated_at":"2015-09-25T12:40:46Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/32045#discussion_r40424845","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32045","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/40424845"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/32045#discussion_r40424845"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32045"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32045","id":45979388,"html_url":"https://github.com/mozilla-b2g/gaia/pull/32045","diff_url":"https://github.com/mozilla-b2g/gaia/pull/32045.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/32045.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32045","number":32045,"state":"open","locked":false,"title":"Bug 1208347 - Add MozIntl API","user":{"login":"zbraniecki","id":449986,"avatar_url":"https://avatars.githubusercontent.com/u/449986?v=3","gravatar_id":"","url":"https://api.github.com/users/zbraniecki","html_url":"https://github.com/zbraniecki","followers_url":"https://api.github.com/users/zbraniecki/followers","following_url":"https://api.github.com/users/zbraniecki/following{/other_user}","gists_url":"https://api.github.com/users/zbraniecki/gists{/gist_id}","starred_url":"https://api.github.com/users/zbraniecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbraniecki/subscriptions","organizations_url":"https://api.github.com/users/zbraniecki/orgs","repos_url":"https://api.github.com/users/zbraniecki/repos","events_url":"https://api.github.com/users/zbraniecki/events{/privacy}","received_events_url":"https://api.github.com/users/zbraniecki/received_events","type":"User","site_admin":false},"body":"https://bugzilla.mozilla.org/show_bug.cgi?id=1208347","created_at":"2015-09-25T05:53:07Z","updated_at":"2015-09-25T12:40:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"849f34f9b77a780ea3c004cf56f957d7d89bc314","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32045/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32045/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32045/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/9b283070cd40fac10baab38a3737fa810ad469b7","head":{"label":"zbraniecki:1208347-add-mozintl-api","ref":"1208347-add-mozintl-api","sha":"9b283070cd40fac10baab38a3737fa810ad469b7","user":{"login":"zbraniecki","id":449986,"avatar_url":"https://avatars.githubusercontent.com/u/449986?v=3","gravatar_id":"","url":"https://api.github.com/users/zbraniecki","html_url":"https://github.com/zbraniecki","followers_url":"https://api.github.com/users/zbraniecki/followers","following_url":"https://api.github.com/users/zbraniecki/following{/other_user}","gists_url":"https://api.github.com/users/zbraniecki/gists{/gist_id}","starred_url":"https://api.github.com/users/zbraniecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbraniecki/subscriptions","organizations_url":"https://api.github.com/users/zbraniecki/orgs","repos_url":"https://api.github.com/users/zbraniecki/repos","events_url":"https://api.github.com/users/zbraniecki/events{/privacy}","received_events_url":"https://api.github.com/users/zbraniecki/received_events","type":"User","site_admin":false},"repo":{"id":3201939,"name":"gaia","full_name":"zbraniecki/gaia","owner":{"login":"zbraniecki","id":449986,"avatar_url":"https://avatars.githubusercontent.com/u/449986?v=3","gravatar_id":"","url":"https://api.github.com/users/zbraniecki","html_url":"https://github.com/zbraniecki","followers_url":"https://api.github.com/users/zbraniecki/followers","following_url":"https://api.github.com/users/zbraniecki/following{/other_user}","gists_url":"https://api.github.com/users/zbraniecki/gists{/gist_id}","starred_url":"https://api.github.com/users/zbraniecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbraniecki/subscriptions","organizations_url":"https://api.github.com/users/zbraniecki/orgs","repos_url":"https://api.github.com/users/zbraniecki/repos","events_url":"https://api.github.com/users/zbraniecki/events{/privacy}","received_events_url":"https://api.github.com/users/zbraniecki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zbraniecki/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project","fork":true,"url":"https://api.github.com/repos/zbraniecki/gaia","forks_url":"https://api.github.com/repos/zbraniecki/gaia/forks","keys_url":"https://api.github.com/repos/zbraniecki/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zbraniecki/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zbraniecki/gaia/teams","hooks_url":"https://api.github.com/repos/zbraniecki/gaia/hooks","issue_events_url":"https://api.github.com/repos/zbraniecki/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/zbraniecki/gaia/events","assignees_url":"https://api.github.com/repos/zbraniecki/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/zbraniecki/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/zbraniecki/gaia/tags","blobs_url":"https://api.github.com/repos/zbraniecki/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zbraniecki/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zbraniecki/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/zbraniecki/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zbraniecki/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/zbraniecki/gaia/languages","stargazers_url":"https://api.github.com/repos/zbraniecki/gaia/stargazers","contributors_url":"https://api.github.com/repos/zbraniecki/gaia/contributors","subscribers_url":"https://api.github.com/repos/zbraniecki/gaia/subscribers","subscription_url":"https://api.github.com/repos/zbraniecki/gaia/subscription","commits_url":"https://api.github.com/repos/zbraniecki/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/zbraniecki/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/zbraniecki/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/zbraniecki/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/zbraniecki/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/zbraniecki/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zbraniecki/gaia/merges","archive_url":"https://api.github.com/repos/zbraniecki/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zbraniecki/gaia/downloads","issues_url":"https://api.github.com/repos/zbraniecki/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/zbraniecki/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/zbraniecki/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/zbraniecki/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zbraniecki/gaia/labels{/name}","releases_url":"https://api.github.com/repos/zbraniecki/gaia/releases{/id}","created_at":"2012-01-17T18:30:26Z","updated_at":"2014-12-29T23:00:20Z","pushed_at":"2015-09-25T05:52:50Z","git_url":"git://github.com/zbraniecki/gaia.git","ssh_url":"git@github.com:zbraniecki/gaia.git","clone_url":"https://github.com/zbraniecki/gaia.git","svn_url":"https://github.com/zbraniecki/gaia","homepage":"https://wiki.mozilla.org/B2G","size":917815,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","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":1,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"165a95e25c03c342f1a134ec0afcee264924ec58","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2015-09-24T09:41:23Z","pushed_at":"2015-09-25T12:33:09Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1640139,"stargazers_count":1983,"watchers_count":1983,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2445,"mirror_url":null,"open_issues_count":1227,"forks":2445,"open_issues":1227,"watchers":1983,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32045"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/32045"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32045"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32045/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32045/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32045/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/9b283070cd40fac10baab38a3737fa810ad469b7"}}}}