{"action":"opened","number":4,"pull_request":{"url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/pulls/4","id":91863592,"html_url":"https://github.com/smokeyheathen/wahwahtoaha/pull/4","diff_url":"https://github.com/smokeyheathen/wahwahtoaha/pull/4.diff","patch_url":"https://github.com/smokeyheathen/wahwahtoaha/pull/4.patch","issue_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/issues/4","number":4,"state":"open","locked":false,"title":"Importing phrases from CSV file via JSON","user":{"login":"axwax","id":590109,"avatar_url":"https://avatars.githubusercontent.com/u/590109?v=3","gravatar_id":"","url":"https://api.github.com/users/axwax","html_url":"https://github.com/axwax","followers_url":"https://api.github.com/users/axwax/followers","following_url":"https://api.github.com/users/axwax/following{/other_user}","gists_url":"https://api.github.com/users/axwax/gists{/gist_id}","starred_url":"https://api.github.com/users/axwax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axwax/subscriptions","organizations_url":"https://api.github.com/users/axwax/orgs","repos_url":"https://api.github.com/users/axwax/repos","events_url":"https://api.github.com/users/axwax/events{/privacy}","received_events_url":"https://api.github.com/users/axwax/received_events","type":"User","site_admin":false},"body":"This is just a quick proof-of-concept for importing phrases - the underlying data format will most probably have to change a bit to be more efficient.\r\n\r\nI've updated the CSV file slightly - have a look [here](https://docs.google.com/spreadsheets/d/1L5PorNJVdVyc_VkHWWENIgX6xXVHKQFqGdScmhCfABc/edit?usp=sharing). Having each tag in a separate column makes live a lot easier during conversion, but I don't know how viable that is for a larger number of tags.\r\n\r\nOnce you download the spreadsheet as CSV you can convert it to JSON [here](http://www.convertcsv.com/csv-to-json.htm) (just leave the default values). Then rename to en-fr.json and upload to the content folder.\r\n\r\nI've documented the functions in the commit descriptions below, so just a quick tl;dr:\r\n\r\nIn the index.js (or when changing languages) you load a phrase file like this: `e.functions.load_phrases(\"en\",\"fr\")`\r\nThis creates an array of phrases in `e.phrases.en.fr`\r\nEach phrase is an object looking like this:\r\n```javascript\r\n{\r\n   \"base\": \"to be\",\r\n   \"target\": \"être\",\r\n   \"literal\": 1,\r\n   \"tags\": [\r\n      \"verb\",\r\n      \"to be\"\r\n   ]\r\n}\r\n```\r\n\r\nSo to access the French translation of phrase 1 in our example above you'd call `e.phrases.en.fr[0].target`.\r\n\r\nI've added a function to search for phrases containing a certain tag (see db6842d).  You can search for phrases containing the tag \"to be\"  by calling \r\n`var phrases = e.functions.search_tag(e.phrases.en.fr, \"to be\")`.\r\nphrases then contains an array of phrase objects. I might add a quick example button to illustrate next...\r\n\r\n\r\n","created_at":"2016-11-01T21:06:45Z","updated_at":"2016-11-01T21:06:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/pulls/4/commits","review_comments_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/pulls/4/comments","review_comment_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/issues/4/comments","statuses_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/statuses/db6842d60d80d2a7ba7582e9963e57ee7511b518","head":{"label":"axwax:master","ref":"master","sha":"db6842d60d80d2a7ba7582e9963e57ee7511b518","user":{"login":"axwax","id":590109,"avatar_url":"https://avatars.githubusercontent.com/u/590109?v=3","gravatar_id":"","url":"https://api.github.com/users/axwax","html_url":"https://github.com/axwax","followers_url":"https://api.github.com/users/axwax/followers","following_url":"https://api.github.com/users/axwax/following{/other_user}","gists_url":"https://api.github.com/users/axwax/gists{/gist_id}","starred_url":"https://api.github.com/users/axwax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axwax/subscriptions","organizations_url":"https://api.github.com/users/axwax/orgs","repos_url":"https://api.github.com/users/axwax/repos","events_url":"https://api.github.com/users/axwax/events{/privacy}","received_events_url":"https://api.github.com/users/axwax/received_events","type":"User","site_admin":false},"repo":{"id":69962648,"name":"wahwahtoaha","full_name":"axwax/wahwahtoaha","owner":{"login":"axwax","id":590109,"avatar_url":"https://avatars.githubusercontent.com/u/590109?v=3","gravatar_id":"","url":"https://api.github.com/users/axwax","html_url":"https://github.com/axwax","followers_url":"https://api.github.com/users/axwax/followers","following_url":"https://api.github.com/users/axwax/following{/other_user}","gists_url":"https://api.github.com/users/axwax/gists{/gist_id}","starred_url":"https://api.github.com/users/axwax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axwax/subscriptions","organizations_url":"https://api.github.com/users/axwax/orgs","repos_url":"https://api.github.com/users/axwax/repos","events_url":"https://api.github.com/users/axwax/events{/privacy}","received_events_url":"https://api.github.com/users/axwax/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/axwax/wahwahtoaha","description":null,"fork":true,"url":"https://api.github.com/repos/axwax/wahwahtoaha","forks_url":"https://api.github.com/repos/axwax/wahwahtoaha/forks","keys_url":"https://api.github.com/repos/axwax/wahwahtoaha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axwax/wahwahtoaha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axwax/wahwahtoaha/teams","hooks_url":"https://api.github.com/repos/axwax/wahwahtoaha/hooks","issue_events_url":"https://api.github.com/repos/axwax/wahwahtoaha/issues/events{/number}","events_url":"https://api.github.com/repos/axwax/wahwahtoaha/events","assignees_url":"https://api.github.com/repos/axwax/wahwahtoaha/assignees{/user}","branches_url":"https://api.github.com/repos/axwax/wahwahtoaha/branches{/branch}","tags_url":"https://api.github.com/repos/axwax/wahwahtoaha/tags","blobs_url":"https://api.github.com/repos/axwax/wahwahtoaha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axwax/wahwahtoaha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axwax/wahwahtoaha/git/refs{/sha}","trees_url":"https://api.github.com/repos/axwax/wahwahtoaha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axwax/wahwahtoaha/statuses/{sha}","languages_url":"https://api.github.com/repos/axwax/wahwahtoaha/languages","stargazers_url":"https://api.github.com/repos/axwax/wahwahtoaha/stargazers","contributors_url":"https://api.github.com/repos/axwax/wahwahtoaha/contributors","subscribers_url":"https://api.github.com/repos/axwax/wahwahtoaha/subscribers","subscription_url":"https://api.github.com/repos/axwax/wahwahtoaha/subscription","commits_url":"https://api.github.com/repos/axwax/wahwahtoaha/commits{/sha}","git_commits_url":"https://api.github.com/repos/axwax/wahwahtoaha/git/commits{/sha}","comments_url":"https://api.github.com/repos/axwax/wahwahtoaha/comments{/number}","issue_comment_url":"https://api.github.com/repos/axwax/wahwahtoaha/issues/comments{/number}","contents_url":"https://api.github.com/repos/axwax/wahwahtoaha/contents/{+path}","compare_url":"https://api.github.com/repos/axwax/wahwahtoaha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axwax/wahwahtoaha/merges","archive_url":"https://api.github.com/repos/axwax/wahwahtoaha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axwax/wahwahtoaha/downloads","issues_url":"https://api.github.com/repos/axwax/wahwahtoaha/issues{/number}","pulls_url":"https://api.github.com/repos/axwax/wahwahtoaha/pulls{/number}","milestones_url":"https://api.github.com/repos/axwax/wahwahtoaha/milestones{/number}","notifications_url":"https://api.github.com/repos/axwax/wahwahtoaha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axwax/wahwahtoaha/labels{/name}","releases_url":"https://api.github.com/repos/axwax/wahwahtoaha/releases{/id}","deployments_url":"https://api.github.com/repos/axwax/wahwahtoaha/deployments","created_at":"2016-10-04T12:26:37Z","updated_at":"2016-10-25T18:22:22Z","pushed_at":"2016-11-01T20:25:36Z","git_url":"git://github.com/axwax/wahwahtoaha.git","ssh_url":"git@github.com:axwax/wahwahtoaha.git","clone_url":"https://github.com/axwax/wahwahtoaha.git","svn_url":"https://github.com/axwax/wahwahtoaha","homepage":null,"size":53,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"smokeyheathen:master","ref":"master","sha":"4aefd8ba29fa99f0f54027a32113cb640ee78fbb","user":{"login":"smokeyheathen","id":20458742,"avatar_url":"https://avatars.githubusercontent.com/u/20458742?v=3","gravatar_id":"","url":"https://api.github.com/users/smokeyheathen","html_url":"https://github.com/smokeyheathen","followers_url":"https://api.github.com/users/smokeyheathen/followers","following_url":"https://api.github.com/users/smokeyheathen/following{/other_user}","gists_url":"https://api.github.com/users/smokeyheathen/gists{/gist_id}","starred_url":"https://api.github.com/users/smokeyheathen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smokeyheathen/subscriptions","organizations_url":"https://api.github.com/users/smokeyheathen/orgs","repos_url":"https://api.github.com/users/smokeyheathen/repos","events_url":"https://api.github.com/users/smokeyheathen/events{/privacy}","received_events_url":"https://api.github.com/users/smokeyheathen/received_events","type":"User","site_admin":false},"repo":{"id":63335308,"name":"wahwahtoaha","full_name":"smokeyheathen/wahwahtoaha","owner":{"login":"smokeyheathen","id":20458742,"avatar_url":"https://avatars.githubusercontent.com/u/20458742?v=3","gravatar_id":"","url":"https://api.github.com/users/smokeyheathen","html_url":"https://github.com/smokeyheathen","followers_url":"https://api.github.com/users/smokeyheathen/followers","following_url":"https://api.github.com/users/smokeyheathen/following{/other_user}","gists_url":"https://api.github.com/users/smokeyheathen/gists{/gist_id}","starred_url":"https://api.github.com/users/smokeyheathen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smokeyheathen/subscriptions","organizations_url":"https://api.github.com/users/smokeyheathen/orgs","repos_url":"https://api.github.com/users/smokeyheathen/repos","events_url":"https://api.github.com/users/smokeyheathen/events{/privacy}","received_events_url":"https://api.github.com/users/smokeyheathen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smokeyheathen/wahwahtoaha","description":null,"fork":false,"url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha","forks_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/forks","keys_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/teams","hooks_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/hooks","issue_events_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/issues/events{/number}","events_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/events","assignees_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/assignees{/user}","branches_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/branches{/branch}","tags_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/tags","blobs_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/git/refs{/sha}","trees_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/statuses/{sha}","languages_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/languages","stargazers_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/stargazers","contributors_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/contributors","subscribers_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/subscribers","subscription_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/subscription","commits_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/commits{/sha}","git_commits_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/git/commits{/sha}","comments_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/comments{/number}","issue_comment_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/issues/comments{/number}","contents_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/contents/{+path}","compare_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/merges","archive_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/downloads","issues_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/issues{/number}","pulls_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/pulls{/number}","milestones_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/milestones{/number}","notifications_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/labels{/name}","releases_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/releases{/id}","deployments_url":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/deployments","created_at":"2016-07-14T12:37:37Z","updated_at":"2016-07-14T12:43:44Z","pushed_at":"2016-11-01T21:06:45Z","git_url":"git://github.com/smokeyheathen/wahwahtoaha.git","ssh_url":"git@github.com:smokeyheathen/wahwahtoaha.git","clone_url":"https://github.com/smokeyheathen/wahwahtoaha.git","svn_url":"https://github.com/smokeyheathen/wahwahtoaha","homepage":null,"size":53,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/pulls/4"},"html":{"href":"https://github.com/smokeyheathen/wahwahtoaha/pull/4"},"issue":{"href":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/issues/4"},"comments":{"href":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/smokeyheathen/wahwahtoaha/statuses/db6842d60d80d2a7ba7582e9963e57ee7511b518"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":7,"additions":2024,"deletions":9,"changed_files":4}}
{"actor":{"display_login":"axwax"}}