{"action":"created","comment":{"url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/comments/84097836","pull_request_review_id":4896708,"id":84097836,"diff_hunk":"@@ -1,9 +1,13 @@\n-var instructions = require('./instructions.json');\n+module.exports = function(_language, _version) {\n+    var version = _version || 'v5';\n+    var language = _language || 'en';\n \n-if (Object !== instructions.constructor) throw 'instructions must be object';\n+    var instructions = require('./instructions').get(language);\n+    if (Object !== instructions.constructor) throw 'instructions must be object';\n \n-module.exports = function(_version) {\n-    var version = _version || 'v5';\n+    function capitalizeFirstLetter(string) {\n+        return string.charAt(0).toUpperCase() + string.slice(1);","path":"index.js","position":13,"original_position":13,"commit_id":"1d7f272f248c1b4f2f0fb24a2efe6d3263cb308d","original_commit_id":"1d7f272f248c1b4f2f0fb24a2efe6d3263cb308d","user":{"login":"1ec5","id":1231218,"avatar_url":"https://avatars.githubusercontent.com/u/1231218?v=3","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/received_events","type":"User","site_admin":false},"body":"See also https://github.com/Project-OSRM/osrm-text-instructions/issues/19#issuecomment-254682885.","created_at":"2016-10-19T15:30:09Z","updated_at":"2016-10-19T15:30:09Z","html_url":"https://github.com/Project-OSRM/osrm-text-instructions/pull/40#discussion_r84097836","pull_request_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/comments/84097836"},"html":{"href":"https://github.com/Project-OSRM/osrm-text-instructions/pull/40#discussion_r84097836"},"pull_request":{"href":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/40","id":90006527,"html_url":"https://github.com/Project-OSRM/osrm-text-instructions/pull/40","diff_url":"https://github.com/Project-OSRM/osrm-text-instructions/pull/40.diff","patch_url":"https://github.com/Project-OSRM/osrm-text-instructions/pull/40.patch","issue_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/issues/40","number":40,"state":"open","locked":false,"title":"Add localization mechanism along with german translation","user":{"login":"contargo-development","id":11087340,"avatar_url":"https://avatars.githubusercontent.com/u/11087340?v=3","gravatar_id":"","url":"https://api.github.com/users/contargo-development","html_url":"https://github.com/contargo-development","followers_url":"https://api.github.com/users/contargo-development/followers","following_url":"https://api.github.com/users/contargo-development/following{/other_user}","gists_url":"https://api.github.com/users/contargo-development/gists{/gist_id}","starred_url":"https://api.github.com/users/contargo-development/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contargo-development/subscriptions","organizations_url":"https://api.github.com/users/contargo-development/orgs","repos_url":"https://api.github.com/users/contargo-development/repos","events_url":"https://api.github.com/users/contargo-development/events{/privacy}","received_events_url":"https://api.github.com/users/contargo-development/received_events","type":"User","site_admin":false},"body":"This adds a simple localization mechanism for instructions. The instructions JSON files are now suffixed with a language identifier, e.g. `instructions_en.json`. The correct json is retrieved by the instructions module.\r\n\r\nIn order to use osrm-text-instructions in osrm-frontend, a few changes to `itinerary_builder.js` and `index.js` files are necessary to propagate the language identifier from osrm-frontend to osrm-text-instructions. I can file another PR in osrm-frontend with these changes if desired.","created_at":"2016-10-19T13:13:49Z","updated_at":"2016-10-19T15:30:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9c7d04d7f46a66c81781564f09537aed5f450cd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/40/commits","review_comments_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/40/comments","review_comment_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/issues/40/comments","statuses_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/statuses/1d7f272f248c1b4f2f0fb24a2efe6d3263cb308d","head":{"label":"Contargo:localization","ref":"localization","sha":"1d7f272f248c1b4f2f0fb24a2efe6d3263cb308d","user":{"login":"Contargo","id":7501514,"avatar_url":"https://avatars.githubusercontent.com/u/7501514?v=3","gravatar_id":"","url":"https://api.github.com/users/Contargo","html_url":"https://github.com/Contargo","followers_url":"https://api.github.com/users/Contargo/followers","following_url":"https://api.github.com/users/Contargo/following{/other_user}","gists_url":"https://api.github.com/users/Contargo/gists{/gist_id}","starred_url":"https://api.github.com/users/Contargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Contargo/subscriptions","organizations_url":"https://api.github.com/users/Contargo/orgs","repos_url":"https://api.github.com/users/Contargo/repos","events_url":"https://api.github.com/users/Contargo/events{/privacy}","received_events_url":"https://api.github.com/users/Contargo/received_events","type":"Organization","site_admin":false},"repo":{"id":71355594,"name":"osrm-text-instructions","full_name":"Contargo/osrm-text-instructions","owner":{"login":"Contargo","id":7501514,"avatar_url":"https://avatars.githubusercontent.com/u/7501514?v=3","gravatar_id":"","url":"https://api.github.com/users/Contargo","html_url":"https://github.com/Contargo","followers_url":"https://api.github.com/users/Contargo/followers","following_url":"https://api.github.com/users/Contargo/following{/other_user}","gists_url":"https://api.github.com/users/Contargo/gists{/gist_id}","starred_url":"https://api.github.com/users/Contargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Contargo/subscriptions","organizations_url":"https://api.github.com/users/Contargo/orgs","repos_url":"https://api.github.com/users/Contargo/repos","events_url":"https://api.github.com/users/Contargo/events{/privacy}","received_events_url":"https://api.github.com/users/Contargo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Contargo/osrm-text-instructions","description":"Text instructions from OSRM route responses","fork":true,"url":"https://api.github.com/repos/Contargo/osrm-text-instructions","forks_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/forks","keys_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/teams","hooks_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/hooks","issue_events_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/issues/events{/number}","events_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/events","assignees_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/assignees{/user}","branches_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/branches{/branch}","tags_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/tags","blobs_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/git/refs{/sha}","trees_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/statuses/{sha}","languages_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/languages","stargazers_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/stargazers","contributors_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/contributors","subscribers_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/subscribers","subscription_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/subscription","commits_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/commits{/sha}","git_commits_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/git/commits{/sha}","comments_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/comments{/number}","issue_comment_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/issues/comments{/number}","contents_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/contents/{+path}","compare_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/merges","archive_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/downloads","issues_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/issues{/number}","pulls_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/pulls{/number}","milestones_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/milestones{/number}","notifications_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/labels{/name}","releases_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/releases{/id}","deployments_url":"https://api.github.com/repos/Contargo/osrm-text-instructions/deployments","created_at":"2016-10-19T12:38:52Z","updated_at":"2016-10-19T12:38:53Z","pushed_at":"2016-10-19T12:56:14Z","git_url":"git://github.com/Contargo/osrm-text-instructions.git","ssh_url":"git@github.com:Contargo/osrm-text-instructions.git","clone_url":"https://github.com/Contargo/osrm-text-instructions.git","svn_url":"https://github.com/Contargo/osrm-text-instructions","homepage":null,"size":139,"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":"Project-OSRM:master","ref":"master","sha":"30392cd972410e62604476bb0ccc524c8a184f9c","user":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"repo":{"id":67210187,"name":"osrm-text-instructions","full_name":"Project-OSRM/osrm-text-instructions","owner":{"login":"Project-OSRM","id":8207060,"avatar_url":"https://avatars.githubusercontent.com/u/8207060?v=3","gravatar_id":"","url":"https://api.github.com/users/Project-OSRM","html_url":"https://github.com/Project-OSRM","followers_url":"https://api.github.com/users/Project-OSRM/followers","following_url":"https://api.github.com/users/Project-OSRM/following{/other_user}","gists_url":"https://api.github.com/users/Project-OSRM/gists{/gist_id}","starred_url":"https://api.github.com/users/Project-OSRM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Project-OSRM/subscriptions","organizations_url":"https://api.github.com/users/Project-OSRM/orgs","repos_url":"https://api.github.com/users/Project-OSRM/repos","events_url":"https://api.github.com/users/Project-OSRM/events{/privacy}","received_events_url":"https://api.github.com/users/Project-OSRM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Project-OSRM/osrm-text-instructions","description":"Text instructions from OSRM route responses","fork":false,"url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions","forks_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/forks","keys_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/teams","hooks_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/hooks","issue_events_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/issues/events{/number}","events_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/events","assignees_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/assignees{/user}","branches_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/branches{/branch}","tags_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/tags","blobs_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/git/refs{/sha}","trees_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/statuses/{sha}","languages_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/languages","stargazers_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/stargazers","contributors_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/contributors","subscribers_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/subscribers","subscription_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/subscription","commits_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/commits{/sha}","git_commits_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/git/commits{/sha}","comments_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/comments{/number}","issue_comment_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/issues/comments{/number}","contents_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/contents/{+path}","compare_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/merges","archive_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/downloads","issues_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/issues{/number}","pulls_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls{/number}","milestones_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/milestones{/number}","notifications_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/labels{/name}","releases_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/releases{/id}","deployments_url":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/deployments","created_at":"2016-09-02T09:33:26Z","updated_at":"2016-10-04T06:55:35Z","pushed_at":"2016-10-19T13:13:49Z","git_url":"git://github.com/Project-OSRM/osrm-text-instructions.git","ssh_url":"git@github.com:Project-OSRM/osrm-text-instructions.git","clone_url":"https://github.com/Project-OSRM/osrm-text-instructions.git","svn_url":"https://github.com/Project-OSRM/osrm-text-instructions","homepage":null,"size":151,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":15,"forks":2,"open_issues":15,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/40"},"html":{"href":"https://github.com/Project-OSRM/osrm-text-instructions/pull/40"},"issue":{"href":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/issues/40"},"comments":{"href":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/Project-OSRM/osrm-text-instructions/statuses/1d7f272f248c1b4f2f0fb24a2efe6d3263cb308d"}}}}
{"actor":{"display_login":"1ec5"}}