{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments/40344845","id":40344845,"diff_hunk":"@@ -0,0 +1,92 @@\n+Feature Name: i18n\n+- Start Date: 2015-09-24\n+- RFC PR: (leave this empty)\n+- Rust Issue: (leave this empty)\n+\n+# Summary\n+\n+This RFC proposes to add an internationalization framework to the rust compiler.\n+\n+#Motivations\n+\n+With the growth of the number of users of Rust, localizing the compiler output would be a big plus.\n+\n+#Proposal\n+\n+We make every user-facing string in the compiler into a key-value pair.\n+\n+For example, the following string output by the compiler:\n+\n+```text\n+test.rs:2:4: 2:6 error: expected one of `.`, `;`, `}`, or an operator, found `::`\n+```\n+\n+would be created via:\n+\n+```Rust\n+format_lang!(\"parser.expected_operator\", expected, found)\n+```\n+\n+We would store all translations in localization files which would contain key value pairs. For example:\n+\n+```\n+// in english file\n+parser.expected_operator = \"expected one of {} or an operator, found {}\"\n+\n+// in french file\n+parser.expected_operator = \"un opérateur ou l'un des symboles suivants était attendu: {}, obtenu: {}\"\n+```\n+\n+If no translation is found, the english localization is used.\n+\n+To use a specific language, one can run rustc as follows:\n+\n+```Shell\n+> rustc --lang fr <other arguments>\n+```\n+\n+##Long diagnostics\n+\n+For error codes / long diagnostics, we keep a different file format for convenience and instead of statically baking in the string, we do a file lookup. The only difference will be that instead of calling:\n+\n+```Rust\n+span_err!(E0123, format!(\"error description {}\", some_substitution));\n+```\n+we will write:\n+\n+```Rust\n+span_err!(diagnostics.E0123, some_substitution);\n+```\n+\n+There will be two diagnostics keys for this, the short and long diagnostic.\n+\n+```\n+diagnostics.E0123.short = \"error description {}\"\n+diagnostics.E0123.long = \"\"\"foo bar baz \\\n+quux \\\n+... \\\n+\"\"\"\n+```\n+\n+##Storage of localizations\n+\n+The localization files should be stored in a folder called i10n, which is part of the rust installation folder. By default, the english files will be there, but if you put the french files there, the option `--lang fr` will work. The folder will look like this:","path":"text/000-i18n.md","position":73,"original_position":73,"commit_id":"28b005e20341dc730e3294822a4a438970e488b8","original_commit_id":"28b005e20341dc730e3294822a4a438970e488b8","user":{"login":"killercup","id":20063,"avatar_url":"https://avatars.githubusercontent.com/u/20063?v=3","gravatar_id":"","url":"https://api.github.com/users/killercup","html_url":"https://github.com/killercup","followers_url":"https://api.github.com/users/killercup/followers","following_url":"https://api.github.com/users/killercup/following{/other_user}","gists_url":"https://api.github.com/users/killercup/gists{/gist_id}","starred_url":"https://api.github.com/users/killercup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/killercup/subscriptions","organizations_url":"https://api.github.com/users/killercup/orgs","repos_url":"https://api.github.com/users/killercup/repos","events_url":"https://api.github.com/users/killercup/events{/privacy}","received_events_url":"https://api.github.com/users/killercup/received_events","type":"User","site_admin":false},"body":"Are there any plans on a file format? Or is this just an implementation detail at this point?","created_at":"2015-09-24T17:11:27Z","updated_at":"2015-09-24T17:11:27Z","html_url":"https://github.com/rust-lang/rfcs/pull/1292#discussion_r40344845","pull_request_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1292","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments/40344845"},"html":{"href":"https://github.com/rust-lang/rfcs/pull/1292#discussion_r40344845"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1292"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1292","id":45922427,"html_url":"https://github.com/rust-lang/rfcs/pull/1292","diff_url":"https://github.com/rust-lang/rfcs/pull/1292.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/1292.patch","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1292","number":1292,"state":"open","locked":false,"title":"i18n","user":{"login":"GuillaumeGomez","id":3050060,"avatar_url":"https://avatars.githubusercontent.com/u/3050060?v=3","gravatar_id":"","url":"https://api.github.com/users/GuillaumeGomez","html_url":"https://github.com/GuillaumeGomez","followers_url":"https://api.github.com/users/GuillaumeGomez/followers","following_url":"https://api.github.com/users/GuillaumeGomez/following{/other_user}","gists_url":"https://api.github.com/users/GuillaumeGomez/gists{/gist_id}","starred_url":"https://api.github.com/users/GuillaumeGomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuillaumeGomez/subscriptions","organizations_url":"https://api.github.com/users/GuillaumeGomez/orgs","repos_url":"https://api.github.com/users/GuillaumeGomez/repos","events_url":"https://api.github.com/users/GuillaumeGomez/events{/privacy}","received_events_url":"https://api.github.com/users/GuillaumeGomez/received_events","type":"User","site_admin":false},"body":"[rendered](https://github.com/GuillaumeGomez/rfcs/blob/master/text/000-i18n.md)\r\n\r\ncc @Manishearth ","created_at":"2015-09-24T17:00:40Z","updated_at":"2015-09-24T17:11:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5f56f52b14436d53aae6851fbccf0abf7848057","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1292/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1292/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1292/comments","statuses_url":"https://api.github.com/repos/rust-lang/rfcs/statuses/28b005e20341dc730e3294822a4a438970e488b8","head":{"label":"GuillaumeGomez:master","ref":"master","sha":"28b005e20341dc730e3294822a4a438970e488b8","user":{"login":"GuillaumeGomez","id":3050060,"avatar_url":"https://avatars.githubusercontent.com/u/3050060?v=3","gravatar_id":"","url":"https://api.github.com/users/GuillaumeGomez","html_url":"https://github.com/GuillaumeGomez","followers_url":"https://api.github.com/users/GuillaumeGomez/followers","following_url":"https://api.github.com/users/GuillaumeGomez/following{/other_user}","gists_url":"https://api.github.com/users/GuillaumeGomez/gists{/gist_id}","starred_url":"https://api.github.com/users/GuillaumeGomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuillaumeGomez/subscriptions","organizations_url":"https://api.github.com/users/GuillaumeGomez/orgs","repos_url":"https://api.github.com/users/GuillaumeGomez/repos","events_url":"https://api.github.com/users/GuillaumeGomez/events{/privacy}","received_events_url":"https://api.github.com/users/GuillaumeGomez/received_events","type":"User","site_admin":false},"repo":{"id":43069858,"name":"rfcs","full_name":"GuillaumeGomez/rfcs","owner":{"login":"GuillaumeGomez","id":3050060,"avatar_url":"https://avatars.githubusercontent.com/u/3050060?v=3","gravatar_id":"","url":"https://api.github.com/users/GuillaumeGomez","html_url":"https://github.com/GuillaumeGomez","followers_url":"https://api.github.com/users/GuillaumeGomez/followers","following_url":"https://api.github.com/users/GuillaumeGomez/following{/other_user}","gists_url":"https://api.github.com/users/GuillaumeGomez/gists{/gist_id}","starred_url":"https://api.github.com/users/GuillaumeGomez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuillaumeGomez/subscriptions","organizations_url":"https://api.github.com/users/GuillaumeGomez/orgs","repos_url":"https://api.github.com/users/GuillaumeGomez/repos","events_url":"https://api.github.com/users/GuillaumeGomez/events{/privacy}","received_events_url":"https://api.github.com/users/GuillaumeGomez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GuillaumeGomez/rfcs","description":"RFCs for changes to Rust","fork":true,"url":"https://api.github.com/repos/GuillaumeGomez/rfcs","forks_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/forks","keys_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/teams","hooks_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/hooks","issue_events_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/events","assignees_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/tags","blobs_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/languages","stargazers_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/stargazers","contributors_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/contributors","subscribers_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/subscribers","subscription_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/subscription","commits_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/issues/comments{/number}","contents_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/merges","archive_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/downloads","issues_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/GuillaumeGomez/rfcs/releases{/id}","created_at":"2015-09-24T13:52:53Z","updated_at":"2015-09-23T16:07:50Z","pushed_at":"2015-09-24T16:55:39Z","git_url":"git://github.com/GuillaumeGomez/rfcs.git","ssh_url":"git@github.com:GuillaumeGomez/rfcs.git","clone_url":"https://github.com/GuillaumeGomez/rfcs.git","svn_url":"https://github.com/GuillaumeGomez/rfcs","homepage":"","size":10681,"stargazers_count":0,"watchers_count":0,"language":null,"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":"rust-lang:master","ref":"master","sha":"8e2d3a3341da533f846f61f10335b72c9a9f4740","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":17527989,"name":"rfcs","full_name":"rust-lang/rfcs","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rfcs","description":"RFCs for changes to Rust","fork":false,"url":"https://api.github.com/repos/rust-lang/rfcs","forks_url":"https://api.github.com/repos/rust-lang/rfcs/forks","keys_url":"https://api.github.com/repos/rust-lang/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rfcs/teams","hooks_url":"https://api.github.com/repos/rust-lang/rfcs/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rfcs/events","assignees_url":"https://api.github.com/repos/rust-lang/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rfcs/tags","blobs_url":"https://api.github.com/repos/rust-lang/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rfcs/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rfcs/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rfcs/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rfcs/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rfcs/subscription","commits_url":"https://api.github.com/repos/rust-lang/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rfcs/merges","archive_url":"https://api.github.com/repos/rust-lang/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rfcs/downloads","issues_url":"https://api.github.com/repos/rust-lang/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rfcs/releases{/id}","created_at":"2014-03-07T21:29:00Z","updated_at":"2015-09-23T16:07:50Z","pushed_at":"2015-09-24T17:00:40Z","git_url":"git://github.com/rust-lang/rfcs.git","ssh_url":"git@github.com:rust-lang/rfcs.git","clone_url":"https://github.com/rust-lang/rfcs.git","svn_url":"https://github.com/rust-lang/rfcs","homepage":"","size":10681,"stargazers_count":461,"watchers_count":461,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":234,"mirror_url":null,"open_issues_count":551,"forks":234,"open_issues":551,"watchers":461,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1292"},"html":{"href":"https://github.com/rust-lang/rfcs/pull/1292"},"issue":{"href":"https://api.github.com/repos/rust-lang/rfcs/issues/1292"},"comments":{"href":"https://api.github.com/repos/rust-lang/rfcs/issues/1292/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1292/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1292/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rfcs/statuses/28b005e20341dc730e3294822a4a438970e488b8"}}}}