{"action":"created","comment":{"url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/comments/83201363","pull_request_review_id":4056926,"id":83201363,"diff_hunk":"@@ -0,0 +1,71 @@\n+angular.module(\"gerritDashboard.i18n\").provider(\"i18n\", [function () {\n+    \"use strict\";\n+\n+    var transMap = {};\n+    var language;\n+    var LANG_STORAGE_KEY = \"dashboardLang\";\n+\n+    var persistenceConfig = {\n+        saveLanguage: function (lang, window) {\n+            try {\n+                window.localStorage.setItem(LANG_STORAGE_KEY, lang);\n+            } catch (e) {\n+                window.sessionStorage.setItem(LANG_STORAGE_KEY, lang);\n+            }\n+        }\n+    };\n+\n+    function setLanguage (lang) {\n+        language = lang;\n+    }\n+\n+    function getLanguage () {\n+        return language;\n+    }\n+\n+    function getLanguageStorageKey () {\n+        return LANG_STORAGE_KEY;\n+    }\n+\n+    return {\n+        translations: transMap,\n+        setLanguage: setLanguage,\n+        getLanguage: getLanguage,\n+        getLanguageStorageKey: getLanguageStorageKey,\n+        persistenceConfig: persistenceConfig,\n+        $get: [\"$window\", function ($window) {\n+            return {\n+                translate: function (key, params) {\n+                    var translatedStr = transMap[language][key] || key;\n+\n+                    if (params) {\n+                        var parametersLength = params.length;\n+\n+                        for (var paramIndex = 0; paramIndex < parametersLength; paramIndex++) {\n+                            var param = params[paramIndex];\n+                            translatedStr = translatedStr.replace(\"{\" + paramIndex + \"}\", param);\n+                        }\n+                    }\n+\n+                    return translatedStr;\n+                },\n+                changeLanguage: function (lang) {\n+                    persistenceConfig.saveLanguage(lang, $window);\n+                    setLanguage(lang);\n+                    $window.location.reload();\n+                },\n+                getLanguage: getLanguage\n+            }\n+        }]\n+    }\n+\n+}]);\n+\n+angular.module(\"gerritDashboard\").config(\n+    [\"i18nProvider\", \"$windowProvider\",\n+        function (i18n, $windowProvider) {\n+            var $window = $windowProvider.$get();\n+            var lang = $window.localStorage.getItem(i18n.getLanguageStorageKey) || \"en\";\n+            i18n.setLanguage(lang);\n+        }\n+    ]);","path":"src/js/module/common/i18n/i18nProvider.js","position":71,"original_position":71,"commit_id":"1007c2d5863d9ac8bea496c5c82c9b297e1bb17b","original_commit_id":"1007c2d5863d9ac8bea496c5c82c9b297e1bb17b","user":{"login":"tunix","id":47731,"avatar_url":"https://avatars.githubusercontent.com/u/47731?v=3","gravatar_id":"","url":"https://api.github.com/users/tunix","html_url":"https://github.com/tunix","followers_url":"https://api.github.com/users/tunix/followers","following_url":"https://api.github.com/users/tunix/following{/other_user}","gists_url":"https://api.github.com/users/tunix/gists{/gist_id}","starred_url":"https://api.github.com/users/tunix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tunix/subscriptions","organizations_url":"https://api.github.com/users/tunix/orgs","repos_url":"https://api.github.com/users/tunix/repos","events_url":"https://api.github.com/users/tunix/events{/privacy}","received_events_url":"https://api.github.com/users/tunix/received_events","type":"User","site_admin":false},"body":"How are we going to change language preference? Will there be something in the UI?","created_at":"2016-10-13T12:13:10Z","updated_at":"2016-10-13T12:16:45Z","html_url":"https://github.com/monitise-mea/gerrit-dashboard-web/pull/13#discussion_r83201363","pull_request_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/comments/83201363"},"html":{"href":"https://github.com/monitise-mea/gerrit-dashboard-web/pull/13#discussion_r83201363"},"pull_request":{"href":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/13","id":89183672,"html_url":"https://github.com/monitise-mea/gerrit-dashboard-web/pull/13","diff_url":"https://github.com/monitise-mea/gerrit-dashboard-web/pull/13.diff","patch_url":"https://github.com/monitise-mea/gerrit-dashboard-web/pull/13.patch","issue_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/issues/13","number":13,"state":"open","locked":false,"title":"Internalization has been added","user":{"login":"lihorecoco","id":7062562,"avatar_url":"https://avatars.githubusercontent.com/u/7062562?v=3","gravatar_id":"","url":"https://api.github.com/users/lihorecoco","html_url":"https://github.com/lihorecoco","followers_url":"https://api.github.com/users/lihorecoco/followers","following_url":"https://api.github.com/users/lihorecoco/following{/other_user}","gists_url":"https://api.github.com/users/lihorecoco/gists{/gist_id}","starred_url":"https://api.github.com/users/lihorecoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lihorecoco/subscriptions","organizations_url":"https://api.github.com/users/lihorecoco/orgs","repos_url":"https://api.github.com/users/lihorecoco/repos","events_url":"https://api.github.com/users/lihorecoco/events{/privacy}","received_events_url":"https://api.github.com/users/lihorecoco/received_events","type":"User","site_admin":false},"body":"- i18n custom direcitive has been created\r\n- Proper static text has been changed with i18n attribute","created_at":"2016-10-13T11:28:14Z","updated_at":"2016-10-13T12:16:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9293b4d6e9d0ddf7727b7d576428ded805052780","assignee":{"login":"lihorecoco","id":7062562,"avatar_url":"https://avatars.githubusercontent.com/u/7062562?v=3","gravatar_id":"","url":"https://api.github.com/users/lihorecoco","html_url":"https://github.com/lihorecoco","followers_url":"https://api.github.com/users/lihorecoco/followers","following_url":"https://api.github.com/users/lihorecoco/following{/other_user}","gists_url":"https://api.github.com/users/lihorecoco/gists{/gist_id}","starred_url":"https://api.github.com/users/lihorecoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lihorecoco/subscriptions","organizations_url":"https://api.github.com/users/lihorecoco/orgs","repos_url":"https://api.github.com/users/lihorecoco/repos","events_url":"https://api.github.com/users/lihorecoco/events{/privacy}","received_events_url":"https://api.github.com/users/lihorecoco/received_events","type":"User","site_admin":false},"assignees":[{"login":"lihorecoco","id":7062562,"avatar_url":"https://avatars.githubusercontent.com/u/7062562?v=3","gravatar_id":"","url":"https://api.github.com/users/lihorecoco","html_url":"https://github.com/lihorecoco","followers_url":"https://api.github.com/users/lihorecoco/followers","following_url":"https://api.github.com/users/lihorecoco/following{/other_user}","gists_url":"https://api.github.com/users/lihorecoco/gists{/gist_id}","starred_url":"https://api.github.com/users/lihorecoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lihorecoco/subscriptions","organizations_url":"https://api.github.com/users/lihorecoco/orgs","repos_url":"https://api.github.com/users/lihorecoco/repos","events_url":"https://api.github.com/users/lihorecoco/events{/privacy}","received_events_url":"https://api.github.com/users/lihorecoco/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/13/commits","review_comments_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/13/comments","review_comment_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/issues/13/comments","statuses_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/statuses/1007c2d5863d9ac8bea496c5c82c9b297e1bb17b","head":{"label":"lihorecoco:master","ref":"master","sha":"1007c2d5863d9ac8bea496c5c82c9b297e1bb17b","user":{"login":"lihorecoco","id":7062562,"avatar_url":"https://avatars.githubusercontent.com/u/7062562?v=3","gravatar_id":"","url":"https://api.github.com/users/lihorecoco","html_url":"https://github.com/lihorecoco","followers_url":"https://api.github.com/users/lihorecoco/followers","following_url":"https://api.github.com/users/lihorecoco/following{/other_user}","gists_url":"https://api.github.com/users/lihorecoco/gists{/gist_id}","starred_url":"https://api.github.com/users/lihorecoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lihorecoco/subscriptions","organizations_url":"https://api.github.com/users/lihorecoco/orgs","repos_url":"https://api.github.com/users/lihorecoco/repos","events_url":"https://api.github.com/users/lihorecoco/events{/privacy}","received_events_url":"https://api.github.com/users/lihorecoco/received_events","type":"User","site_admin":false},"repo":{"id":57104595,"name":"gerrit-dashboard-web","full_name":"lihorecoco/gerrit-dashboard-web","owner":{"login":"lihorecoco","id":7062562,"avatar_url":"https://avatars.githubusercontent.com/u/7062562?v=3","gravatar_id":"","url":"https://api.github.com/users/lihorecoco","html_url":"https://github.com/lihorecoco","followers_url":"https://api.github.com/users/lihorecoco/followers","following_url":"https://api.github.com/users/lihorecoco/following{/other_user}","gists_url":"https://api.github.com/users/lihorecoco/gists{/gist_id}","starred_url":"https://api.github.com/users/lihorecoco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lihorecoco/subscriptions","organizations_url":"https://api.github.com/users/lihorecoco/orgs","repos_url":"https://api.github.com/users/lihorecoco/repos","events_url":"https://api.github.com/users/lihorecoco/events{/privacy}","received_events_url":"https://api.github.com/users/lihorecoco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lihorecoco/gerrit-dashboard-web","description":"UI that shows different metrics using Gerrit Dashboard Server","fork":true,"url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web","forks_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/forks","keys_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/teams","hooks_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/hooks","issue_events_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/issues/events{/number}","events_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/events","assignees_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/assignees{/user}","branches_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/branches{/branch}","tags_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/tags","blobs_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/statuses/{sha}","languages_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/languages","stargazers_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/stargazers","contributors_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/contributors","subscribers_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/subscribers","subscription_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/subscription","commits_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/contents/{+path}","compare_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/merges","archive_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/downloads","issues_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/issues{/number}","pulls_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/pulls{/number}","milestones_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/milestones{/number}","notifications_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/labels{/name}","releases_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/releases{/id}","deployments_url":"https://api.github.com/repos/lihorecoco/gerrit-dashboard-web/deployments","created_at":"2016-04-26T06:44:07Z","updated_at":"2016-04-26T06:44:08Z","pushed_at":"2016-10-13T11:24:36Z","git_url":"git://github.com/lihorecoco/gerrit-dashboard-web.git","ssh_url":"git@github.com:lihorecoco/gerrit-dashboard-web.git","clone_url":"https://github.com/lihorecoco/gerrit-dashboard-web.git","svn_url":"https://github.com/lihorecoco/gerrit-dashboard-web","homepage":"","size":30,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"monitise-mea:master","ref":"master","sha":"41eba7716a396ddd995539bc99cd32d98812ecc1","user":{"login":"monitise-mea","id":16475418,"avatar_url":"https://avatars.githubusercontent.com/u/16475418?v=3","gravatar_id":"","url":"https://api.github.com/users/monitise-mea","html_url":"https://github.com/monitise-mea","followers_url":"https://api.github.com/users/monitise-mea/followers","following_url":"https://api.github.com/users/monitise-mea/following{/other_user}","gists_url":"https://api.github.com/users/monitise-mea/gists{/gist_id}","starred_url":"https://api.github.com/users/monitise-mea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monitise-mea/subscriptions","organizations_url":"https://api.github.com/users/monitise-mea/orgs","repos_url":"https://api.github.com/users/monitise-mea/repos","events_url":"https://api.github.com/users/monitise-mea/events{/privacy}","received_events_url":"https://api.github.com/users/monitise-mea/received_events","type":"Organization","site_admin":false},"repo":{"id":50845554,"name":"gerrit-dashboard-web","full_name":"monitise-mea/gerrit-dashboard-web","owner":{"login":"monitise-mea","id":16475418,"avatar_url":"https://avatars.githubusercontent.com/u/16475418?v=3","gravatar_id":"","url":"https://api.github.com/users/monitise-mea","html_url":"https://github.com/monitise-mea","followers_url":"https://api.github.com/users/monitise-mea/followers","following_url":"https://api.github.com/users/monitise-mea/following{/other_user}","gists_url":"https://api.github.com/users/monitise-mea/gists{/gist_id}","starred_url":"https://api.github.com/users/monitise-mea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monitise-mea/subscriptions","organizations_url":"https://api.github.com/users/monitise-mea/orgs","repos_url":"https://api.github.com/users/monitise-mea/repos","events_url":"https://api.github.com/users/monitise-mea/events{/privacy}","received_events_url":"https://api.github.com/users/monitise-mea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/monitise-mea/gerrit-dashboard-web","description":"UI that shows different metrics using Gerrit Dashboard Server","fork":false,"url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web","forks_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/forks","keys_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/teams","hooks_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/hooks","issue_events_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/issues/events{/number}","events_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/events","assignees_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/assignees{/user}","branches_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/branches{/branch}","tags_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/tags","blobs_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/statuses/{sha}","languages_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/languages","stargazers_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/stargazers","contributors_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/contributors","subscribers_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/subscribers","subscription_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/subscription","commits_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/contents/{+path}","compare_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/merges","archive_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/downloads","issues_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/issues{/number}","pulls_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls{/number}","milestones_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/milestones{/number}","notifications_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/labels{/name}","releases_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/releases{/id}","deployments_url":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/deployments","created_at":"2016-02-01T14:42:53Z","updated_at":"2016-04-26T13:58:37Z","pushed_at":"2016-10-13T11:28:14Z","git_url":"git://github.com/monitise-mea/gerrit-dashboard-web.git","ssh_url":"git@github.com:monitise-mea/gerrit-dashboard-web.git","clone_url":"https://github.com/monitise-mea/gerrit-dashboard-web.git","svn_url":"https://github.com/monitise-mea/gerrit-dashboard-web","homepage":"","size":31,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/13"},"html":{"href":"https://github.com/monitise-mea/gerrit-dashboard-web/pull/13"},"issue":{"href":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/issues/13"},"comments":{"href":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/monitise-mea/gerrit-dashboard-web/statuses/1007c2d5863d9ac8bea496c5c82c9b297e1bb17b"}}}}
{"actor":{"display_login":"tunix"}}