{"action":"created","comment":{"url":"https://api.github.com/repos/cozy/cozy-home/pulls/comments/43891123","id":43891123,"diff_hunk":"@@ -38,17 +38,24 @@ class exports.Application\n             @instance = window.cozy_instance or {}\n             @locale = @instance?.locale or 'en'\n \n+            defaultLocales = require 'locales/en'\n             try\n                 locales = require 'locales/' + @locale\n             catch err\n-                locales = require 'locales/en'\n+                locales = defaultLocales\n \n             window.app = @\n \n             # Translation\n             @polyglot = new Polyglot()\n             @polyglot.extend locales\n-            window.t = @polyglot.t.bind @polyglot\n+            @defaultPolyglot  = new Polyglot\n+                locale: 'en'\n+                phrases: defaultLocales\n+            window.t = (key, params = {}) =>\n+                unless params._?\n+                    params._ = @defaultPolyglot?.t(key, params)","path":"client/app/initialize.coffee","position":22,"original_position":22,"commit_id":"7bb878e787c6a9abc57459def2db4c75e22fef8c","original_commit_id":"7bb878e787c6a9abc57459def2db4c75e22fef8c","user":{"login":"nono","id":2767,"avatar_url":"https://avatars.githubusercontent.com/u/2767?v=3","gravatar_id":"","url":"https://api.github.com/users/nono","html_url":"https://github.com/nono","followers_url":"https://api.github.com/users/nono/followers","following_url":"https://api.github.com/users/nono/following{/other_user}","gists_url":"https://api.github.com/users/nono/gists{/gist_id}","starred_url":"https://api.github.com/users/nono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nono/subscriptions","organizations_url":"https://api.github.com/users/nono/orgs","repos_url":"https://api.github.com/users/nono/repos","events_url":"https://api.github.com/users/nono/events{/privacy}","received_events_url":"https://api.github.com/users/nono/received_events","type":"User","site_admin":false},"body":"@clochix you can write:\r\n\r\n```coffee\r\nparams._ ?= @defaultPolyglot?.t(key, params)\r\n```","created_at":"2015-11-04T15:09:09Z","updated_at":"2015-11-04T15:09:09Z","html_url":"https://github.com/cozy/cozy-home/pull/565#discussion_r43891123","pull_request_url":"https://api.github.com/repos/cozy/cozy-home/pulls/565","_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-home/pulls/comments/43891123"},"html":{"href":"https://github.com/cozy/cozy-home/pull/565#discussion_r43891123"},"pull_request":{"href":"https://api.github.com/repos/cozy/cozy-home/pulls/565"}}},"pull_request":{"url":"https://api.github.com/repos/cozy/cozy-home/pulls/565","id":49697958,"html_url":"https://github.com/cozy/cozy-home/pull/565","diff_url":"https://github.com/cozy/cozy-home/pull/565.diff","patch_url":"https://github.com/cozy/cozy-home/pull/565.patch","issue_url":"https://api.github.com/repos/cozy/cozy-home/issues/565","number":565,"state":"open","locked":false,"title":"Use english as default language","user":{"login":"clochix","id":384908,"avatar_url":"https://avatars.githubusercontent.com/u/384908?v=3","gravatar_id":"","url":"https://api.github.com/users/clochix","html_url":"https://github.com/clochix","followers_url":"https://api.github.com/users/clochix/followers","following_url":"https://api.github.com/users/clochix/following{/other_user}","gists_url":"https://api.github.com/users/clochix/gists{/gist_id}","starred_url":"https://api.github.com/users/clochix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clochix/subscriptions","organizations_url":"https://api.github.com/users/clochix/orgs","repos_url":"https://api.github.com/users/clochix/repos","events_url":"https://api.github.com/users/clochix/events{/privacy}","received_events_url":"https://api.github.com/users/clochix/received_events","type":"User","site_admin":false},"body":"This prevent displaying the key when a translation is missing.","created_at":"2015-11-04T14:55:33Z","updated_at":"2015-11-04T15:09:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8df57e5f38ebd780ad4d5505de5dc3d1ee644f28","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cozy/cozy-home/pulls/565/commits","review_comments_url":"https://api.github.com/repos/cozy/cozy-home/pulls/565/comments","review_comment_url":"https://api.github.com/repos/cozy/cozy-home/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cozy/cozy-home/issues/565/comments","statuses_url":"https://api.github.com/repos/cozy/cozy-home/statuses/7bb878e787c6a9abc57459def2db4c75e22fef8c","head":{"label":"clochix:master","ref":"master","sha":"7bb878e787c6a9abc57459def2db4c75e22fef8c","user":{"login":"clochix","id":384908,"avatar_url":"https://avatars.githubusercontent.com/u/384908?v=3","gravatar_id":"","url":"https://api.github.com/users/clochix","html_url":"https://github.com/clochix","followers_url":"https://api.github.com/users/clochix/followers","following_url":"https://api.github.com/users/clochix/following{/other_user}","gists_url":"https://api.github.com/users/clochix/gists{/gist_id}","starred_url":"https://api.github.com/users/clochix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clochix/subscriptions","organizations_url":"https://api.github.com/users/clochix/orgs","repos_url":"https://api.github.com/users/clochix/repos","events_url":"https://api.github.com/users/clochix/events{/privacy}","received_events_url":"https://api.github.com/users/clochix/received_events","type":"User","site_admin":false},"repo":{"id":32756343,"name":"cozy-home","full_name":"clochix/cozy-home","owner":{"login":"clochix","id":384908,"avatar_url":"https://avatars.githubusercontent.com/u/384908?v=3","gravatar_id":"","url":"https://api.github.com/users/clochix","html_url":"https://github.com/clochix","followers_url":"https://api.github.com/users/clochix/followers","following_url":"https://api.github.com/users/clochix/following{/other_user}","gists_url":"https://api.github.com/users/clochix/gists{/gist_id}","starred_url":"https://api.github.com/users/clochix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clochix/subscriptions","organizations_url":"https://api.github.com/users/clochix/orgs","repos_url":"https://api.github.com/users/clochix/repos","events_url":"https://api.github.com/users/clochix/events{/privacy}","received_events_url":"https://api.github.com/users/clochix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/clochix/cozy-home","description":"Gateway to your Cozy applications","fork":true,"url":"https://api.github.com/repos/clochix/cozy-home","forks_url":"https://api.github.com/repos/clochix/cozy-home/forks","keys_url":"https://api.github.com/repos/clochix/cozy-home/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clochix/cozy-home/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clochix/cozy-home/teams","hooks_url":"https://api.github.com/repos/clochix/cozy-home/hooks","issue_events_url":"https://api.github.com/repos/clochix/cozy-home/issues/events{/number}","events_url":"https://api.github.com/repos/clochix/cozy-home/events","assignees_url":"https://api.github.com/repos/clochix/cozy-home/assignees{/user}","branches_url":"https://api.github.com/repos/clochix/cozy-home/branches{/branch}","tags_url":"https://api.github.com/repos/clochix/cozy-home/tags","blobs_url":"https://api.github.com/repos/clochix/cozy-home/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clochix/cozy-home/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clochix/cozy-home/git/refs{/sha}","trees_url":"https://api.github.com/repos/clochix/cozy-home/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clochix/cozy-home/statuses/{sha}","languages_url":"https://api.github.com/repos/clochix/cozy-home/languages","stargazers_url":"https://api.github.com/repos/clochix/cozy-home/stargazers","contributors_url":"https://api.github.com/repos/clochix/cozy-home/contributors","subscribers_url":"https://api.github.com/repos/clochix/cozy-home/subscribers","subscription_url":"https://api.github.com/repos/clochix/cozy-home/subscription","commits_url":"https://api.github.com/repos/clochix/cozy-home/commits{/sha}","git_commits_url":"https://api.github.com/repos/clochix/cozy-home/git/commits{/sha}","comments_url":"https://api.github.com/repos/clochix/cozy-home/comments{/number}","issue_comment_url":"https://api.github.com/repos/clochix/cozy-home/issues/comments{/number}","contents_url":"https://api.github.com/repos/clochix/cozy-home/contents/{+path}","compare_url":"https://api.github.com/repos/clochix/cozy-home/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clochix/cozy-home/merges","archive_url":"https://api.github.com/repos/clochix/cozy-home/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clochix/cozy-home/downloads","issues_url":"https://api.github.com/repos/clochix/cozy-home/issues{/number}","pulls_url":"https://api.github.com/repos/clochix/cozy-home/pulls{/number}","milestones_url":"https://api.github.com/repos/clochix/cozy-home/milestones{/number}","notifications_url":"https://api.github.com/repos/clochix/cozy-home/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clochix/cozy-home/labels{/name}","releases_url":"https://api.github.com/repos/clochix/cozy-home/releases{/id}","created_at":"2015-03-23T20:13:58Z","updated_at":"2015-04-20T19:46:35Z","pushed_at":"2015-11-04T14:54:15Z","git_url":"git://github.com/clochix/cozy-home.git","ssh_url":"git@github.com:clochix/cozy-home.git","clone_url":"https://github.com/clochix/cozy-home.git","svn_url":"https://github.com/clochix/cozy-home","homepage":"https://demo.cozycloud.cc/","size":39175,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"master"}},"base":{"label":"cozy:development","ref":"development","sha":"97464b3582d04cccbc65cd2f9d033427696e2952","user":{"login":"cozy","id":7690525,"avatar_url":"https://avatars.githubusercontent.com/u/7690525?v=3","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"repo":{"id":3807749,"name":"cozy-home","full_name":"cozy/cozy-home","owner":{"login":"cozy","id":7690525,"avatar_url":"https://avatars.githubusercontent.com/u/7690525?v=3","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cozy/cozy-home","description":"Gateway to your Cozy applications","fork":false,"url":"https://api.github.com/repos/cozy/cozy-home","forks_url":"https://api.github.com/repos/cozy/cozy-home/forks","keys_url":"https://api.github.com/repos/cozy/cozy-home/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cozy/cozy-home/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cozy/cozy-home/teams","hooks_url":"https://api.github.com/repos/cozy/cozy-home/hooks","issue_events_url":"https://api.github.com/repos/cozy/cozy-home/issues/events{/number}","events_url":"https://api.github.com/repos/cozy/cozy-home/events","assignees_url":"https://api.github.com/repos/cozy/cozy-home/assignees{/user}","branches_url":"https://api.github.com/repos/cozy/cozy-home/branches{/branch}","tags_url":"https://api.github.com/repos/cozy/cozy-home/tags","blobs_url":"https://api.github.com/repos/cozy/cozy-home/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cozy/cozy-home/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cozy/cozy-home/git/refs{/sha}","trees_url":"https://api.github.com/repos/cozy/cozy-home/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cozy/cozy-home/statuses/{sha}","languages_url":"https://api.github.com/repos/cozy/cozy-home/languages","stargazers_url":"https://api.github.com/repos/cozy/cozy-home/stargazers","contributors_url":"https://api.github.com/repos/cozy/cozy-home/contributors","subscribers_url":"https://api.github.com/repos/cozy/cozy-home/subscribers","subscription_url":"https://api.github.com/repos/cozy/cozy-home/subscription","commits_url":"https://api.github.com/repos/cozy/cozy-home/commits{/sha}","git_commits_url":"https://api.github.com/repos/cozy/cozy-home/git/commits{/sha}","comments_url":"https://api.github.com/repos/cozy/cozy-home/comments{/number}","issue_comment_url":"https://api.github.com/repos/cozy/cozy-home/issues/comments{/number}","contents_url":"https://api.github.com/repos/cozy/cozy-home/contents/{+path}","compare_url":"https://api.github.com/repos/cozy/cozy-home/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cozy/cozy-home/merges","archive_url":"https://api.github.com/repos/cozy/cozy-home/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cozy/cozy-home/downloads","issues_url":"https://api.github.com/repos/cozy/cozy-home/issues{/number}","pulls_url":"https://api.github.com/repos/cozy/cozy-home/pulls{/number}","milestones_url":"https://api.github.com/repos/cozy/cozy-home/milestones{/number}","notifications_url":"https://api.github.com/repos/cozy/cozy-home/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cozy/cozy-home/labels{/name}","releases_url":"https://api.github.com/repos/cozy/cozy-home/releases{/id}","created_at":"2012-03-23T11:40:03Z","updated_at":"2015-11-04T08:31:20Z","pushed_at":"2015-11-04T14:55:33Z","git_url":"git://github.com/cozy/cozy-home.git","ssh_url":"git@github.com:cozy/cozy-home.git","clone_url":"https://github.com/cozy/cozy-home.git","svn_url":"https://github.com/cozy/cozy-home","homepage":"https://demo.cozycloud.cc/","size":40173,"stargazers_count":80,"watchers_count":80,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":93,"forks":49,"open_issues":93,"watchers":80,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-home/pulls/565"},"html":{"href":"https://github.com/cozy/cozy-home/pull/565"},"issue":{"href":"https://api.github.com/repos/cozy/cozy-home/issues/565"},"comments":{"href":"https://api.github.com/repos/cozy/cozy-home/issues/565/comments"},"review_comments":{"href":"https://api.github.com/repos/cozy/cozy-home/pulls/565/comments"},"review_comment":{"href":"https://api.github.com/repos/cozy/cozy-home/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cozy/cozy-home/pulls/565/commits"},"statuses":{"href":"https://api.github.com/repos/cozy/cozy-home/statuses/7bb878e787c6a9abc57459def2db4c75e22fef8c"}}}}