{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular.io/pulls/comments/80363938","id":80363938,"diff_hunk":"@@ -0,0 +1,302 @@\n+include ../_util-fns\n+\n+:marked\n+  With internationalization, also known as i18n, we can display our website in multiple languages. There are two different\n+  approaches to internationalization: with AoT compilation which requires a build step and a full reload when the language changes,\n+  or with JiT which doesn't require a full reload and uses bindings to determine when a translation is needed.\n+  \n+  \n+  \n+  <a id=\"top\"></a>\n+  ## Table of contents\n+  \n+  [Different approaches to internationalization](#approaches-internationalization)\n+  \n+    * [JiT](#jit)\n+    * [AoT](#aot)\n+    \n+  [Angular and i18n](#angular2-i18n)\n+  \n+    * [i18n directive](#i18n-directive)\n+    * [i18n plural pipe](#i18n-plural-pipe)\n+    * [i18n select pipe](#i18n-select-pipe)\n+    \n+  [Extract and use translations](#extract)\n+  \n+    * [Extract messages with ng-xi18n](#ng-xi18n)\n+    * [Translate messages](#translate)\n+    * [Use translations with the JiT approach](#use-jit)\n+    * [Use translations with the AoT approach](#use-aot)\n+\n+  \n+.l-main-section\n+<a id=\"approaches-internationalization\"></a>\n+:marked\n+  ## Different approaches to internationalization\n+\n+  \n+a(id=\"jit\")\n+.l-main-section\n+:marked\n+  ### Just in time (JiT) approach\n+  \n+  The JiT approach relies on providing the translations to our application and binding them to our templates using directives, pipes and interpolations.\n+  \n+  Its main features are:\n+    * Minimal server side support required:  The same version of the application code is served by the server.\n+    However, the server must also serve translated message bundles back to the application or have tools that embed all\n+    translations in the application code at build time.\n+    * Our application must track all the pieces of the UI that need to be updated when the locale changes.\n+    In addition, if the new language strings are being loaded over the network, this could take time and the UI needs to indicate this in some way to the user.\n+    * Allows one to support multiple languages in the same view.","path":"public/docs/ts/latest/guide/i18n.jade","position":51,"original_position":51,"commit_id":"c48eff3f0eaff3f0505f5b53896f294ba1e239f0","original_commit_id":"f7271497068ad734a76c94479ae4463df142bdcf","user":{"login":"vicb","id":248818,"avatar_url":"https://avatars.githubusercontent.com/u/248818?v=3","gravatar_id":"","url":"https://api.github.com/users/vicb","html_url":"https://github.com/vicb","followers_url":"https://api.github.com/users/vicb/followers","following_url":"https://api.github.com/users/vicb/following{/other_user}","gists_url":"https://api.github.com/users/vicb/gists{/gist_id}","starred_url":"https://api.github.com/users/vicb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicb/subscriptions","organizations_url":"https://api.github.com/users/vicb/orgs","repos_url":"https://api.github.com/users/vicb/repos","events_url":"https://api.github.com/users/vicb/events{/privacy}","received_events_url":"https://api.github.com/users/vicb/received_events","type":"User","site_admin":false},"body":"nothing currently exists","created_at":"2016-09-24T16:22:03Z","updated_at":"2016-09-24T16:22:03Z","html_url":"https://github.com/angular/angular.io/pull/2340#discussion_r80363938","pull_request_url":"https://api.github.com/repos/angular/angular.io/pulls/2340","_links":{"self":{"href":"https://api.github.com/repos/angular/angular.io/pulls/comments/80363938"},"html":{"href":"https://github.com/angular/angular.io/pull/2340#discussion_r80363938"},"pull_request":{"href":"https://api.github.com/repos/angular/angular.io/pulls/2340"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular.io/pulls/2340","id":85261924,"html_url":"https://github.com/angular/angular.io/pull/2340","diff_url":"https://github.com/angular/angular.io/pull/2340.diff","patch_url":"https://github.com/angular/angular.io/pull/2340.patch","issue_url":"https://api.github.com/repos/angular/angular.io/issues/2340","number":2340,"state":"open","locked":false,"title":"I18n guide","user":{"login":"Foxandxss","id":1087957,"avatar_url":"https://avatars.githubusercontent.com/u/1087957?v=3","gravatar_id":"","url":"https://api.github.com/users/Foxandxss","html_url":"https://github.com/Foxandxss","followers_url":"https://api.github.com/users/Foxandxss/followers","following_url":"https://api.github.com/users/Foxandxss/following{/other_user}","gists_url":"https://api.github.com/users/Foxandxss/gists{/gist_id}","starred_url":"https://api.github.com/users/Foxandxss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Foxandxss/subscriptions","organizations_url":"https://api.github.com/users/Foxandxss/orgs","repos_url":"https://api.github.com/users/Foxandxss/repos","events_url":"https://api.github.com/users/Foxandxss/events{/privacy}","received_events_url":"https://api.github.com/users/Foxandxss/received_events","type":"User","site_admin":false},"body":"This supersedes #2309","created_at":"2016-09-14T16:33:18Z","updated_at":"2016-09-24T16:22:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1025929f2624e7c853286fed20f42133728c1c3","assignee":{"login":"filipesilva","id":4172079,"avatar_url":"https://avatars.githubusercontent.com/u/4172079?v=3","gravatar_id":"","url":"https://api.github.com/users/filipesilva","html_url":"https://github.com/filipesilva","followers_url":"https://api.github.com/users/filipesilva/followers","following_url":"https://api.github.com/users/filipesilva/following{/other_user}","gists_url":"https://api.github.com/users/filipesilva/gists{/gist_id}","starred_url":"https://api.github.com/users/filipesilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipesilva/subscriptions","organizations_url":"https://api.github.com/users/filipesilva/orgs","repos_url":"https://api.github.com/users/filipesilva/repos","events_url":"https://api.github.com/users/filipesilva/events{/privacy}","received_events_url":"https://api.github.com/users/filipesilva/received_events","type":"User","site_admin":false},"assignees":[{"login":"filipesilva","id":4172079,"avatar_url":"https://avatars.githubusercontent.com/u/4172079?v=3","gravatar_id":"","url":"https://api.github.com/users/filipesilva","html_url":"https://github.com/filipesilva","followers_url":"https://api.github.com/users/filipesilva/followers","following_url":"https://api.github.com/users/filipesilva/following{/other_user}","gists_url":"https://api.github.com/users/filipesilva/gists{/gist_id}","starred_url":"https://api.github.com/users/filipesilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipesilva/subscriptions","organizations_url":"https://api.github.com/users/filipesilva/orgs","repos_url":"https://api.github.com/users/filipesilva/repos","events_url":"https://api.github.com/users/filipesilva/events{/privacy}","received_events_url":"https://api.github.com/users/filipesilva/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/angular/angular.io/milestones/4","html_url":"https://github.com/angular/angular.io/milestones/AngularConnect","labels_url":"https://api.github.com/repos/angular/angular.io/milestones/4/labels","id":1648991,"number":4,"title":"AngularConnect","description":"","creator":{"login":"wardbell","id":129061,"avatar_url":"https://avatars.githubusercontent.com/u/129061?v=3","gravatar_id":"","url":"https://api.github.com/users/wardbell","html_url":"https://github.com/wardbell","followers_url":"https://api.github.com/users/wardbell/followers","following_url":"https://api.github.com/users/wardbell/following{/other_user}","gists_url":"https://api.github.com/users/wardbell/gists{/gist_id}","starred_url":"https://api.github.com/users/wardbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wardbell/subscriptions","organizations_url":"https://api.github.com/users/wardbell/orgs","repos_url":"https://api.github.com/users/wardbell/repos","events_url":"https://api.github.com/users/wardbell/events{/privacy}","received_events_url":"https://api.github.com/users/wardbell/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":2,"state":"open","created_at":"2016-03-16T21:04:31Z","updated_at":"2016-09-23T12:05:28Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/angular/angular.io/pulls/2340/commits","review_comments_url":"https://api.github.com/repos/angular/angular.io/pulls/2340/comments","review_comment_url":"https://api.github.com/repos/angular/angular.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular.io/issues/2340/comments","statuses_url":"https://api.github.com/repos/angular/angular.io/statuses/c48eff3f0eaff3f0505f5b53896f294ba1e239f0","head":{"label":"IdeaBlade:i18n-guide","ref":"i18n-guide","sha":"c48eff3f0eaff3f0505f5b53896f294ba1e239f0","user":{"login":"IdeaBlade","id":1630193,"avatar_url":"https://avatars.githubusercontent.com/u/1630193?v=3","gravatar_id":"","url":"https://api.github.com/users/IdeaBlade","html_url":"https://github.com/IdeaBlade","followers_url":"https://api.github.com/users/IdeaBlade/followers","following_url":"https://api.github.com/users/IdeaBlade/following{/other_user}","gists_url":"https://api.github.com/users/IdeaBlade/gists{/gist_id}","starred_url":"https://api.github.com/users/IdeaBlade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IdeaBlade/subscriptions","organizations_url":"https://api.github.com/users/IdeaBlade/orgs","repos_url":"https://api.github.com/users/IdeaBlade/repos","events_url":"https://api.github.com/users/IdeaBlade/events{/privacy}","received_events_url":"https://api.github.com/users/IdeaBlade/received_events","type":"Organization","site_admin":false},"repo":{"id":40154922,"name":"angular.io","full_name":"IdeaBlade/angular.io","owner":{"login":"IdeaBlade","id":1630193,"avatar_url":"https://avatars.githubusercontent.com/u/1630193?v=3","gravatar_id":"","url":"https://api.github.com/users/IdeaBlade","html_url":"https://github.com/IdeaBlade","followers_url":"https://api.github.com/users/IdeaBlade/followers","following_url":"https://api.github.com/users/IdeaBlade/following{/other_user}","gists_url":"https://api.github.com/users/IdeaBlade/gists{/gist_id}","starred_url":"https://api.github.com/users/IdeaBlade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IdeaBlade/subscriptions","organizations_url":"https://api.github.com/users/IdeaBlade/orgs","repos_url":"https://api.github.com/users/IdeaBlade/repos","events_url":"https://api.github.com/users/IdeaBlade/events{/privacy}","received_events_url":"https://api.github.com/users/IdeaBlade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IdeaBlade/angular.io","description":"Website for Angular 2","fork":true,"url":"https://api.github.com/repos/IdeaBlade/angular.io","forks_url":"https://api.github.com/repos/IdeaBlade/angular.io/forks","keys_url":"https://api.github.com/repos/IdeaBlade/angular.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IdeaBlade/angular.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IdeaBlade/angular.io/teams","hooks_url":"https://api.github.com/repos/IdeaBlade/angular.io/hooks","issue_events_url":"https://api.github.com/repos/IdeaBlade/angular.io/issues/events{/number}","events_url":"https://api.github.com/repos/IdeaBlade/angular.io/events","assignees_url":"https://api.github.com/repos/IdeaBlade/angular.io/assignees{/user}","branches_url":"https://api.github.com/repos/IdeaBlade/angular.io/branches{/branch}","tags_url":"https://api.github.com/repos/IdeaBlade/angular.io/tags","blobs_url":"https://api.github.com/repos/IdeaBlade/angular.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IdeaBlade/angular.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IdeaBlade/angular.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/IdeaBlade/angular.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IdeaBlade/angular.io/statuses/{sha}","languages_url":"https://api.github.com/repos/IdeaBlade/angular.io/languages","stargazers_url":"https://api.github.com/repos/IdeaBlade/angular.io/stargazers","contributors_url":"https://api.github.com/repos/IdeaBlade/angular.io/contributors","subscribers_url":"https://api.github.com/repos/IdeaBlade/angular.io/subscribers","subscription_url":"https://api.github.com/repos/IdeaBlade/angular.io/subscription","commits_url":"https://api.github.com/repos/IdeaBlade/angular.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/IdeaBlade/angular.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/IdeaBlade/angular.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/IdeaBlade/angular.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/IdeaBlade/angular.io/contents/{+path}","compare_url":"https://api.github.com/repos/IdeaBlade/angular.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IdeaBlade/angular.io/merges","archive_url":"https://api.github.com/repos/IdeaBlade/angular.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IdeaBlade/angular.io/downloads","issues_url":"https://api.github.com/repos/IdeaBlade/angular.io/issues{/number}","pulls_url":"https://api.github.com/repos/IdeaBlade/angular.io/pulls{/number}","milestones_url":"https://api.github.com/repos/IdeaBlade/angular.io/milestones{/number}","notifications_url":"https://api.github.com/repos/IdeaBlade/angular.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IdeaBlade/angular.io/labels{/name}","releases_url":"https://api.github.com/repos/IdeaBlade/angular.io/releases{/id}","deployments_url":"https://api.github.com/repos/IdeaBlade/angular.io/deployments","created_at":"2015-08-04T00:40:19Z","updated_at":"2016-06-03T13:30:56Z","pushed_at":"2016-09-24T13:46:11Z","git_url":"git://github.com/IdeaBlade/angular.io.git","ssh_url":"git@github.com:IdeaBlade/angular.io.git","clone_url":"https://github.com/IdeaBlade/angular.io.git","svn_url":"https://github.com/IdeaBlade/angular.io","homepage":"https://angular.io","size":48118,"stargazers_count":6,"watchers_count":6,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":0,"forks":7,"open_issues":0,"watchers":6,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"c348e8332dee9520c49c69ae6bfa1b00d8e3f785","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":31985425,"name":"angular.io","full_name":"angular/angular.io","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular.io","description":"Website for Angular 2","fork":false,"url":"https://api.github.com/repos/angular/angular.io","forks_url":"https://api.github.com/repos/angular/angular.io/forks","keys_url":"https://api.github.com/repos/angular/angular.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular.io/teams","hooks_url":"https://api.github.com/repos/angular/angular.io/hooks","issue_events_url":"https://api.github.com/repos/angular/angular.io/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular.io/events","assignees_url":"https://api.github.com/repos/angular/angular.io/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular.io/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular.io/tags","blobs_url":"https://api.github.com/repos/angular/angular.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular.io/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular.io/languages","stargazers_url":"https://api.github.com/repos/angular/angular.io/stargazers","contributors_url":"https://api.github.com/repos/angular/angular.io/contributors","subscribers_url":"https://api.github.com/repos/angular/angular.io/subscribers","subscription_url":"https://api.github.com/repos/angular/angular.io/subscription","commits_url":"https://api.github.com/repos/angular/angular.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular.io/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular.io/merges","archive_url":"https://api.github.com/repos/angular/angular.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular.io/downloads","issues_url":"https://api.github.com/repos/angular/angular.io/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular.io/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular.io/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular.io/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular.io/releases{/id}","deployments_url":"https://api.github.com/repos/angular/angular.io/deployments","created_at":"2015-03-10T22:32:34Z","updated_at":"2016-09-24T05:35:25Z","pushed_at":"2016-09-24T13:49:37Z","git_url":"git://github.com/angular/angular.io.git","ssh_url":"git@github.com:angular/angular.io.git","clone_url":"https://github.com/angular/angular.io.git","svn_url":"https://github.com/angular/angular.io","homepage":"https://angular.io","size":53273,"stargazers_count":617,"watchers_count":617,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":741,"mirror_url":null,"open_issues_count":247,"forks":741,"open_issues":247,"watchers":617,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular.io/pulls/2340"},"html":{"href":"https://github.com/angular/angular.io/pull/2340"},"issue":{"href":"https://api.github.com/repos/angular/angular.io/issues/2340"},"comments":{"href":"https://api.github.com/repos/angular/angular.io/issues/2340/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular.io/pulls/2340/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular.io/pulls/2340/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular.io/statuses/c48eff3f0eaff3f0505f5b53896f294ba1e239f0"}}}}
{"actor":{"display_login":"vicb"}}